{"version":3,"file":"index-Dbw4rBX9.js","sources":["../../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/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/rollup-plugin-node-polyfills/polyfills/global.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/resolve-pathname/esm/resolve-pathname.js","../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../node_modules/react-router/node_modules/history/esm/history.js","../../node_modules/isarray/index.js","../../node_modules/path-to-regexp/index.js","../../node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/react-is/index.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/react-router/esm/react-router.js","../../node_modules/react-router-dom/node_modules/history/esm/history.js","../../node_modules/react-router-dom/esm/react-router-dom.js","../../node_modules/process/browser.js","../../node_modules/axios/lib/helpers/bind.js","../../node_modules/axios/lib/utils.js","../../node_modules/base64-js/index.js","../../node_modules/ieee754/index.js","../../node_modules/buffer/index.js","../../node_modules/axios/lib/core/AxiosError.js","../../node_modules/axios/lib/helpers/null.js","../../node_modules/axios/lib/helpers/toFormData.js","../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/axios/lib/helpers/buildURL.js","../../node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/axios/lib/defaults/transitional.js","../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/axios/lib/platform/browser/index.js","../../node_modules/axios/lib/platform/common/utils.js","../../node_modules/axios/lib/platform/index.js","../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/axios/lib/defaults/index.js","../../node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/axios/lib/core/transformData.js","../../node_modules/axios/lib/cancel/isCancel.js","../../node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/axios/lib/core/settle.js","../../node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/axios/lib/helpers/speedometer.js","../../node_modules/axios/lib/helpers/throttle.js","../../node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/axios/lib/helpers/cookies.js","../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/axios/lib/core/buildFullPath.js","../../node_modules/axios/lib/core/mergeConfig.js","../../node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/axios/lib/adapters/xhr.js","../../node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/axios/lib/helpers/trackStream.js","../../node_modules/axios/lib/adapters/fetch.js","../../node_modules/axios/lib/adapters/adapters.js","../../node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/axios/lib/env/data.js","../../node_modules/axios/lib/helpers/validator.js","../../node_modules/axios/lib/core/Axios.js","../../node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/axios/lib/helpers/spread.js","../../node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/axios/lib/axios.js","../../node_modules/axios/index.js","../../node_modules/@azure/msal-common/dist/utils/Constants.mjs","../../node_modules/@azure/msal-common/dist/error/AuthErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/AuthError.mjs","../../node_modules/@azure/msal-common/dist/error/ClientAuthErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/ClientAuthError.mjs","../../node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs","../../node_modules/@azure/msal-common/dist/logger/Logger.mjs","../../node_modules/@azure/msal-common/dist/packageMetadata.mjs","../../node_modules/@azure/msal-common/dist/authority/AuthorityOptions.mjs","../../node_modules/@azure/msal-common/dist/account/AuthToken.mjs","../../node_modules/@azure/msal-common/dist/utils/TimeUtils.mjs","../../node_modules/@azure/msal-common/dist/cache/utils/CacheHelpers.mjs","../../node_modules/@azure/msal-common/dist/error/ClientConfigurationErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/ClientConfigurationError.mjs","../../node_modules/@azure/msal-common/dist/utils/StringUtils.mjs","../../node_modules/@azure/msal-common/dist/request/ScopeSet.mjs","../../node_modules/@azure/msal-common/dist/account/ClientInfo.mjs","../../node_modules/@azure/msal-common/dist/account/AccountInfo.mjs","../../node_modules/@azure/msal-common/dist/authority/AuthorityType.mjs","../../node_modules/@azure/msal-common/dist/account/TokenClaims.mjs","../../node_modules/@azure/msal-common/dist/authority/ProtocolMode.mjs","../../node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.mjs","../../node_modules/@azure/msal-common/dist/utils/UrlUtils.mjs","../../node_modules/@azure/msal-common/dist/url/UrlString.mjs","../../node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.mjs","../../node_modules/@azure/msal-common/dist/error/CacheErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/CacheError.mjs","../../node_modules/@azure/msal-common/dist/cache/CacheManager.mjs","../../node_modules/@azure/msal-common/dist/config/ClientConfiguration.mjs","../../node_modules/@azure/msal-common/dist/account/CcsCredential.mjs","../../node_modules/@azure/msal-common/dist/constants/AADServerParamKeys.mjs","../../node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.mjs","../../node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.mjs","../../node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.mjs","../../node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs","../../node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.mjs","../../node_modules/@azure/msal-common/dist/utils/FunctionWrappers.mjs","../../node_modules/@azure/msal-common/dist/authority/RegionDiscovery.mjs","../../node_modules/@azure/msal-common/dist/authority/Authority.mjs","../../node_modules/@azure/msal-common/dist/authority/AuthorityFactory.mjs","../../node_modules/@azure/msal-common/dist/error/ServerError.mjs","../../node_modules/@azure/msal-common/dist/network/RequestThumbprint.mjs","../../node_modules/@azure/msal-common/dist/network/ThrottlingUtils.mjs","../../node_modules/@azure/msal-common/dist/error/NetworkError.mjs","../../node_modules/@azure/msal-common/dist/client/BaseClient.mjs","../../node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.mjs","../../node_modules/@azure/msal-common/dist/utils/ProtocolUtils.mjs","../../node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs","../../node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.mjs","../../node_modules/@azure/msal-common/dist/response/ResponseHandler.mjs","../../node_modules/@azure/msal-common/dist/request/RequestValidator.mjs","../../node_modules/@azure/msal-common/dist/utils/ClientAssertionUtils.mjs","../../node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.mjs","../../node_modules/@azure/msal-common/dist/client/RefreshTokenClient.mjs","../../node_modules/@azure/msal-common/dist/client/SilentFlowClient.mjs","../../node_modules/@azure/msal-common/dist/network/INetworkModule.mjs","../../node_modules/@azure/msal-common/dist/protocol/Authorize.mjs","../../node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.mjs","../../node_modules/@azure/msal-common/dist/error/JoseHeaderErrorCodes.mjs","../../node_modules/@azure/msal-common/dist/error/JoseHeaderError.mjs","../../node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs","../../node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.mjs","../../node_modules/@azure/msal-browser/dist/error/BrowserAuthErrorCodes.mjs","../../node_modules/@azure/msal-browser/dist/error/BrowserAuthError.mjs","../../node_modules/@azure/msal-browser/dist/utils/BrowserConstants.mjs","../../node_modules/@azure/msal-browser/dist/encode/Base64Encode.mjs","../../node_modules/@azure/msal-browser/dist/encode/Base64Decode.mjs","../../node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs","../../node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthErrorCodes.mjs","../../node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthError.mjs","../../node_modules/@azure/msal-browser/dist/utils/BrowserUtils.mjs","../../node_modules/@azure/msal-browser/dist/navigation/NavigationClient.mjs","../../node_modules/@azure/msal-browser/dist/network/FetchClient.mjs","../../node_modules/@azure/msal-browser/dist/config/Configuration.mjs","../../node_modules/@azure/msal-browser/dist/packageMetadata.mjs","../../node_modules/@azure/msal-browser/dist/operatingcontext/BaseOperatingContext.mjs","../../node_modules/@azure/msal-browser/dist/operatingcontext/StandardOperatingContext.mjs","../../node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs","../../node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs","../../node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs","../../node_modules/@azure/msal-browser/dist/crypto/CryptoOps.mjs","../../node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs","../../node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs","../../node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs","../../node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs","../../node_modules/@azure/msal-browser/dist/utils/BrowserProtocolUtils.mjs","../../node_modules/@azure/msal-browser/dist/event/EventType.mjs","../../node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs","../../node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs","../../node_modules/@azure/msal-browser/dist/event/EventHandler.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/BaseInteractionClient.mjs","../../node_modules/@azure/msal-browser/dist/request/RequestHelpers.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/StandardInteractionClient.mjs","../../node_modules/@azure/msal-browser/dist/error/NativeAuthErrorCodes.mjs","../../node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs","../../node_modules/@azure/msal-browser/dist/error/NativeAuthError.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentCacheClient.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/NativeInteractionClient.mjs","../../node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs","../../node_modules/@azure/msal-browser/dist/interaction_handler/InteractionHandler.mjs","../../node_modules/@azure/msal-browser/dist/response/ResponseHandler.mjs","../../node_modules/@azure/msal-browser/dist/protocol/Authorize.mjs","../../node_modules/@azure/msal-browser/dist/crypto/PkceGenerator.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.mjs","../../node_modules/@azure/msal-browser/dist/interaction_handler/RedirectHandler.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/RedirectClient.mjs","../../node_modules/@azure/msal-browser/dist/interaction_handler/SilentHandler.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentIframeClient.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentRefreshClient.mjs","../../node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentAuthCodeClient.mjs","../../node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs","../../node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs","../../node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs","../../node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs","../../node_modules/@azure/msal-browser/dist/event/EventMessage.mjs","../../src/authConfig.js","../../src/authService.js","../../src/ApiRequest.js","../../node_modules/classnames/index.js","../../node_modules/react-bootstrap/esm/ThemeProvider.js","../../node_modules/react-bootstrap/esm/Container.js","../../node_modules/react-bootstrap/esm/Row.js","../../node_modules/react-bootstrap/esm/Col.js","../../node_modules/@progress/kendo-react-common/dist/es/contexts/ZIndexContext.js","../../node_modules/@progress/kendo-react-common/dist/es/browser-support.service.js","../../node_modules/@progress/kendo-react-common/dist/es/canUseDOM.js","../../node_modules/@progress/kendo-react-common/dist/es/classNames.js","../../node_modules/@progress/kendo-react-common/dist/es/getTabIndex.js","../../node_modules/@progress/kendo-react-common/dist/es/constants/index.js","../../node_modules/@progress/kendo-react-common/dist/es/fieldList.js","../../node_modules/@progress/kendo-react-common/dist/es/getter.js","../../node_modules/@progress/kendo-react-common/dist/es/guid.js","../../node_modules/@progress/kendo-react-common/dist/es/keys.js","../../node_modules/@progress/kendo-react-common/dist/es/noop.js","../../node_modules/@progress/kendo-react-common/dist/es/scrollbarWidth.js","../../node_modules/@progress/kendo-licensing/dist/index.mjs","../../node_modules/@progress/kendo-react-common/dist/es/validate-package.js","../../node_modules/@progress/kendo-react-common/dist/es/hasRelativeStackingContext.js","../../node_modules/@progress/kendo-react-common/dist/es/watermark/WatermarkOverlay.js","../../node_modules/@progress/kendo-react-common/dist/es/events/dispatchEvent.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useAsyncFocusBlur.js","../../node_modules/@progress/kendo-react-common/dist/es/hocs/AsyncFocusBlur.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/usePropsContext.js","../../node_modules/@progress/kendo-react-common/dist/es/hocs/withPropsContext.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useDir.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useRtl.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useMouse.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useCustomComponent.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useDocument.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/constants.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/Icon.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/SvgIcon.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/IconsContext.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/IconWrap.js","../../node_modules/@progress/kendo-react-common/dist/es/icons/utils.js","../../node_modules/@progress/kendo-draggable-common/dist/es/algorithms/intersect.js","../../node_modules/@progress/kendo-draggable-common/dist/es/utils/index.js","../../node_modules/@progress/kendo-draggable-common/dist/es/drag-n-drop.js","../../node_modules/@progress/kendo-draggable-common/dist/es/auto-scroll.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useInheritedState.js","../../node_modules/@progress/kendo-react-common/dist/es/drag-n-drop/context/index.js","../../node_modules/@progress/kendo-react-common/dist/es/hooks/useDraggable.js","../../node_modules/@progress/kendo-react-common/dist/es/Draggable.js","../../node_modules/@progress/kendo-react-common/dist/es/theme.js","../../node_modules/@progress/kendo-react-common/dist/es/memoize.js","../../node_modules/@progress/kendo-react-common/dist/es/navigation.js","../../node_modules/@progress/kendo-react-common/dist/es/getActiveElement.js","../../node_modules/@progress/kendo-react-buttons/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Button.js","../../node_modules/@progress/kendo-react-popup/dist/es/animation.js","../../node_modules/@progress/kendo-popup-common/dist/es/align-point.js","../../node_modules/@progress/kendo-popup-common/dist/es/align.js","../../node_modules/@progress/kendo-popup-common/dist/es/add-scroll.js","../../node_modules/@progress/kendo-popup-common/dist/es/owner-document.js","../../node_modules/@progress/kendo-popup-common/dist/es/window.js","../../node_modules/@progress/kendo-popup-common/dist/es/document.js","../../node_modules/@progress/kendo-popup-common/dist/es/scrollbar-width.js","../../node_modules/@progress/kendo-popup-common/dist/es/window-viewport.js","../../node_modules/@progress/kendo-popup-common/dist/es/bounding-offset.js","../../node_modules/@progress/kendo-popup-common/dist/es/offset-parent.js","../../node_modules/@progress/kendo-popup-common/dist/es/offset.js","../../node_modules/@progress/kendo-popup-common/dist/es/parents.js","../../node_modules/@progress/kendo-popup-common/dist/es/scroll-position.js","../../node_modules/@progress/kendo-popup-common/dist/es/element-scroll-position.js","../../node_modules/@progress/kendo-popup-common/dist/es/parent-scroll-position.js","../../node_modules/@progress/kendo-popup-common/dist/es/position.js","../../node_modules/@progress/kendo-popup-common/dist/es/offset-parent-scroll-position.js","../../node_modules/@progress/kendo-popup-common/dist/es/position-with-scroll.js","../../node_modules/@progress/kendo-popup-common/dist/es/remove-scroll.js","../../node_modules/@progress/kendo-popup-common/dist/es/collision.js","../../node_modules/@progress/kendo-popup-common/dist/es/restrict-to-view.js","../../node_modules/@progress/kendo-popup-common/dist/es/siblings.js","../../node_modules/@progress/kendo-popup-common/dist/es/sibling-container.js","../../node_modules/@progress/kendo-popup-common/dist/es/utils.js","../../node_modules/@progress/kendo-popup-common/dist/es/dom-utils.js","../../node_modules/@progress/kendo-popup-common/dist/es/align-element.js","../../node_modules/@progress/kendo-popup-common/dist/es/position-element.js","../../node_modules/@progress/kendo-react-popup/dist/es/util.js","../../node_modules/@progress/kendo-react-popup/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-popup/dist/es/PopupWithoutContext.js","../../node_modules/@progress/kendo-react-popup/dist/es/Popup.js","../../node_modules/@progress/kendo-svg-icons/dist/index.es.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Chip/selection-reducer.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Chip/focus-reducer.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Chip/data-reducer.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Chip/ChipList.js","../../node_modules/@progress/kendo-react-buttons/dist/es/Chip/Chip.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/messages/index.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/default-data.js","../../node_modules/@progress/kendo-intl/dist/es/common/is-string.js","../../node_modules/@progress/kendo-intl/dist/es/error-details.js","../../node_modules/@progress/kendo-intl/dist/es/errors.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/info.js","../../node_modules/@progress/kendo-intl/dist/es/common/constants.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/territory.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/date-field-name.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/date-format-names.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/parse-range-date.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/currency.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/constants.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/first-day.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/weekend-range.js","../../node_modules/@progress/kendo-intl/dist/es/cldr/number-symbols.js","../../node_modules/@progress/kendo-intl/dist/es/common/is-negative-zero.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/format-currency-symbol.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/group-integer.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/is-currency-style.js","../../node_modules/@progress/kendo-intl/dist/es/common/pad.js","../../node_modules/@progress/kendo-intl/dist/es/common/round.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/standard-number-format.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/utils.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/custom-number-format.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/format-options.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/format-number.js","../../node_modules/@progress/kendo-intl/dist/es/common/is-number.js","../../node_modules/@progress/kendo-intl/dist/es/numbers/parse-number.js","../../node_modules/@progress/kendo-intl/dist/es/common/format-string.js","../../node_modules/@progress/kendo-intl/dist/es/dates/date-pattern.js","../../node_modules/@progress/kendo-intl/dist/es/dates/date-name-type.js","../../node_modules/@progress/kendo-intl/dist/es/dates/format-names.js","../../node_modules/@progress/kendo-intl/dist/es/common/is-date.js","../../node_modules/@progress/kendo-intl/dist/es/dates/constants.js","../../node_modules/@progress/kendo-intl/dist/es/dates/format-date.js","../../node_modules/@progress/kendo-intl/dist/es/dates/time-utils.js","../../node_modules/@progress/kendo-intl/dist/es/dates/parse-date.js","../../node_modules/@progress/kendo-intl/dist/es/dates/split-date-format.js","../../node_modules/@progress/kendo-intl/dist/es/format.js","../../node_modules/@progress/kendo-react-intl/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-intl/dist/es/Intl/IntlService.js","../../node_modules/@progress/kendo-react-intl/dist/es/Localization/messages.js","../../node_modules/@progress/kendo-react-intl/dist/es/Localization/LocalizationService.js","../../node_modules/@progress/kendo-react-intl/dist/es/globalization/GlobalizationContext.js","../../node_modules/@progress/kendo-react-intl/dist/es/Intl/IntlProvider.js","../../node_modules/@progress/kendo-react-intl/dist/es/Localization/loadMessages.js","../../node_modules/@progress/kendo-react-intl/dist/es/Localization/LocalizationProvider.js","../../node_modules/@progress/kendo-react-intl/dist/es/intlUtils.js","../../node_modules/@progress/kendo-react-intl/dist/es/hooks/useInternationalization.js","../../node_modules/@progress/kendo-react-intl/dist/es/hooks/useLocalization.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/pager/PagerNumericButtons.js","../../node_modules/@progress/kendo-react-labels/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-labels/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-labels/dist/es/FloatingLabel.js","../../node_modules/@progress/kendo-react-inputs/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-inputs/dist/es/input/Input.js","../../node_modules/@progress/kendo-react-inputs/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/parsing/result.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/parsing/stream.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/parsing/parsers.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/parsing/combinators.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/masking.service.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/utils.js","../../node_modules/@progress/kendo-react-inputs/dist/es/maskedtextbox/MaskedTextBox.js","../../node_modules/@progress/kendo-react-inputs/dist/es/numerictextbox/utils/index.js","../../node_modules/@progress/kendo-react-inputs/dist/es/numerictextbox/NumericTextBox.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/DialogTitleBar.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/DialogActionsBar.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/constants.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/utils.js","../../node_modules/@progress/kendo-react-dialogs/dist/es/Dialog.js","../../node_modules/@progress/kendo-react-inputs/dist/es/textbox/Textbox.js","../../node_modules/@progress/kendo-react-inputs/dist/es/input/InputPrefix.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/pager/PagerInput.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ListContainer.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ListFilter.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/GroupStickyHeader.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/utils.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ListDefaultItem.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ListItem.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ListGroupItem.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/List.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/VirtualScroll.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/Navigation.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/DropDownBase.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/constants.js","../../node_modules/@progress/kendo-react-layout/dist/es/tabstrip/TabStripNavigationItem.js","../../node_modules/@progress/kendo-react-layout/dist/es/tabstrip/TabStripNavigation.js","../../node_modules/dom-helpers/esm/hasClass.js","../../node_modules/dom-helpers/esm/addClass.js","../../node_modules/dom-helpers/esm/removeClass.js","../../node_modules/react-transition-group/esm/config.js","../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../node_modules/react-transition-group/esm/Transition.js","../../node_modules/react-transition-group/esm/CSSTransition.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/@progress/kendo-react-animation/dist/es/util.js","../../node_modules/@progress/kendo-react-animation/dist/es/AnimationChild.js","../../node_modules/@progress/kendo-react-animation/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-animation/dist/es/Animation.js","../../node_modules/@progress/kendo-react-animation/dist/es/Fade.js","../../node_modules/@progress/kendo-react-animation/dist/es/Slide.js","../../node_modules/@progress/kendo-react-animation/dist/es/hooks/useAnimation.js","../../node_modules/@progress/kendo-react-layout/dist/es/tabstrip/TabStripContent.js","../../node_modules/@progress/kendo-react-layout/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-layout/dist/es/tabstrip/TabStrip.js","../../node_modules/@progress/kendo-react-layout/dist/es/tabstrip/TabStripTab.js","../../node_modules/@progress/kendo-react-progressbars/dist/es/common/constants.js","../../node_modules/@progress/kendo-react-progressbars/dist/es/common/utils.js","../../node_modules/@progress/kendo-react-progressbars/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-progressbars/dist/es/progressbar/hooks/usePrevious.js","../../node_modules/@progress/kendo-react-progressbars/dist/es/progressbar/ProgressBar.js","../../node_modules/@progress/kendo-react-layout/dist/es/actionsheet/ActionSheetItem.js","../../node_modules/@progress/kendo-react-layout/dist/es/actionsheet/ActionSheetHeader.js","../../node_modules/@progress/kendo-react-layout/dist/es/actionsheet/ActionSheetFooter.js","../../node_modules/@progress/kendo-react-layout/dist/es/actionsheet/ActionSheetContent.js","../../node_modules/@progress/kendo-react-layout/dist/es/actionsheet/ActionSheet.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/DropDownList/DropDownList.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/SearchBar.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/ClearButton.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/ComboBox/ComboBox.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/MultiSelect/TagList.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/settings.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/common/AdaptiveMode.js","../../node_modules/@progress/kendo-react-dropdowns/dist/es/MultiSelect/MultiSelect.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/pager/PagerPageSizes.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/pager/Pager.js","../../node_modules/@progress/kendo-date-math/dist/es/clone-date.js","../../node_modules/@progress/kendo-date-math/dist/es/adjust-dst.js","../../node_modules/@progress/kendo-date-math/dist/es/add-days.js","../../node_modules/@progress/kendo-date-math/dist/es/create-date.js","../../node_modules/@progress/kendo-date-math/dist/es/last-day-of-month.js","../../node_modules/@progress/kendo-date-math/dist/es/add-months.js","../../node_modules/@progress/kendo-date-math/dist/es/set-year.js","../../node_modules/@progress/kendo-date-math/dist/es/add-years.js","../../node_modules/@progress/kendo-date-math/dist/es/add-centuries.js","../../node_modules/@progress/kendo-date-math/dist/es/add-decades.js","../../node_modules/@progress/kendo-date-math/dist/es/add-weeks.js","../../node_modules/@progress/kendo-date-math/dist/es/constants.js","../../node_modules/@progress/kendo-date-math/dist/es/direction.enum.js","../../node_modules/@progress/kendo-date-math/dist/es/day-of-week.js","../../node_modules/@progress/kendo-date-math/dist/es/day.enum.js","../../node_modules/@progress/kendo-date-math/dist/es/normalize-year.js","../../node_modules/@progress/kendo-date-math/dist/es/first-decade-of-century.js","../../node_modules/@progress/kendo-date-math/dist/es/duration-in-centuries.js","../../node_modules/@progress/kendo-date-math/dist/es/first-year-of-decade.js","../../node_modules/@progress/kendo-date-math/dist/es/duration-in-decades.js","../../node_modules/@progress/kendo-date-math/dist/es/duration-in-months.js","../../node_modules/@progress/kendo-date-math/dist/es/duration-in-years.js","../../node_modules/@progress/kendo-date-math/dist/es/first-day-of-month.js","../../node_modules/@progress/kendo-date-math/dist/es/set-month.js","../../node_modules/@progress/kendo-date-math/dist/es/first-month-of-year.js","../../node_modules/@progress/kendo-date-math/dist/es/get-date.js","../../node_modules/@progress/kendo-date-math/dist/es/is-equal.js","../../node_modules/@progress/kendo-date-math/dist/es/is-equal-date.js","../../node_modules/@progress/kendo-date-math/dist/es/last-decade-of-century.js","../../node_modules/@progress/kendo-date-math/dist/es/last-month-of-year.js","../../node_modules/@progress/kendo-date-math/dist/es/last-year-of-decade.js","../../node_modules/@progress/kendo-date-math/dist/es/prev-day-of-week.js","../../node_modules/@progress/kendo-date-math/dist/es/week-in-year.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/virtualization/services/RowHeightService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/virtualization/services/ScrollerService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/virtualization/Virtualization.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/CalendarCell.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/CalendarWeekCell.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/models/NavigationAction.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/models/CalendarViewEnum.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/models/SelectionRange.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/utils.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/CenturyViewService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/DecadeViewService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/MonthViewService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/YearViewService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/BusViewService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/DOMService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/NavigationService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/ScrollSyncService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/services/WeekNamesService.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/View.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/CalendarHeaderTitle.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/Header.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/TodayCommand.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/ViewList.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/CalendarNavigationItem.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/Navigation.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/calendar/components/Calendar.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/dateinput/models/mask.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/dateinput/utils.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/dateinput/models/kendo-date.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/timepicker/utils.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/dateinput/DateInput.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/datepicker/ToggleButton.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/common/PickerWrap.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/hooks/usePickerFloatingLabel.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/common/AdaptiveMode.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/common/constants.js","../../node_modules/@progress/kendo-react-dateinputs/dist/es/datepicker/DatePicker.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/navigation/constants.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/navigation/TableKeyboardNavigationContext.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/navigation/hooks.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/header/HeaderThElement.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/navigation/utils.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/header/utils/index.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/drag/ColumnResizer.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/virtualization/columns.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/drag/DragClue.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/drag/DropClue.js","../../node_modules/@progress/kendo-data-query/dist/es/utils.js","../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-descriptor.interface.js","../../node_modules/@progress/kendo-data-query/dist/es/funcs.js","../../node_modules/@progress/kendo-data-query/dist/es/filter-serialization.common.js","../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter.operators.js","../../node_modules/@progress/kendo-data-query/dist/es/accessor.js","../../node_modules/@progress/kendo-data-query/dist/es/mvc/operators.js","../../node_modules/@progress/kendo-data-query/dist/es/mvc/deserialization.js","../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-no-eval.js","../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-expression.factory.js","../../node_modules/@progress/kendo-data-query/dist/es/filtering/operators.enum.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/navigation/TableKeyboardNavigation.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/selection/constants.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/selection/utils.js","../../node_modules/@progress/kendo-react-data-tools/dist/es/selection/TableSelection.js","../../node_modules/@progress/kendo-react-grid/dist/es/GridColumn.js","../../node_modules/@progress/kendo-react-grid/dist/es/utils/index.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridSelectionCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridHierarchyCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/constants/index.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridEditCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/Header.js","../../node_modules/@progress/kendo-react-grid/dist/es/interfaces/GridSortSettings.js","../../node_modules/@progress/kendo-react-grid/dist/es/drag/ColumnDraggable.js","../../node_modules/@progress/kendo-react-grid/dist/es/columnMenu/GridColumnMenuWrapper.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/GridHeaderCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/HeaderRow.js","../../node_modules/@progress/kendo-react-grid/dist/es/filterCommon.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridFilterCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/FilterRow.js","../../node_modules/@progress/kendo-react-grid/dist/es/drag/GroupingIndicator.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/GroupPanel.js","../../node_modules/@progress/kendo-react-grid/dist/es/footer/Footer.js","../../node_modules/@progress/kendo-react-grid/dist/es/VirtualScroll.js","../../node_modules/@progress/kendo-react-grid/dist/es/VirtualScrollFixed.js","../../node_modules/@progress/kendo-react-grid/dist/es/drag/ColumnResize.js","../../node_modules/@progress/kendo-react-grid/dist/es/drag/CommonDragLogic.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridGroupCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/rows/GridRow.js","../../node_modules/@progress/kendo-react-grid/dist/es/header/GridHeaderSelectionCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/GridNoRecords.js","../../node_modules/@progress/kendo-react-grid/dist/es/footer/FooterRow.js","../../node_modules/@progress/kendo-react-grid/dist/es/paging/GridPagerSettings.js","../../node_modules/@progress/kendo-react-grid/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridDetailCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/cells/GridDetailHierarchyCell.js","../../node_modules/@progress/kendo-react-grid/dist/es/Grid.js","../../node_modules/moment/dist/moment.js","../../node_modules/dompurify/dist/purify.es.mjs","../../node_modules/lodash/lodash.js","../../src/aso/shared/UniteDropDownListNoData.jsx","../../src/aso/shared/ListNoData.jsx","../../src/aso/shared/UniteDropDownListAlly.jsx","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../node_modules/use-sync-external-store/shim/with-selector.js","../../node_modules/react-redux/es/utils/batch.js","../../node_modules/react-redux/es/components/Context.js","../../node_modules/react-redux/es/hooks/useReduxContext.js","../../node_modules/react-redux/es/utils/useSyncExternalStore.js","../../node_modules/react-redux/es/hooks/useSelector.js","../../node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/react-redux/node_modules/react-is/index.js","../../node_modules/react-redux/es/utils/Subscription.js","../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","../../node_modules/react-redux/es/components/Provider.js","../../node_modules/react-redux/es/hooks/useStore.js","../../node_modules/react-redux/es/hooks/useDispatch.js","../../node_modules/react-redux/es/index.js","../../src/aso/shared/Subfooter.jsx","../../node_modules/@progress/kendo-react-indicators/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-indicators/dist/es/loader/Loader.js","../../node_modules/@progress/kendo-react-notification/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-notification/dist/es/Notification.js","../../node_modules/@progress/kendo-react-notification/dist/es/NotificationGroup.js","../../src/aso/shared/UserMessage.jsx","../../src/aso/shared/shared.jsx","../../src/aso/shared/FocusLock.jsx","../../src/aso/shared/ConfirmationDialog.jsx","../../src/aso/EditProfilePanel.jsx","../../src/aso/panel.jsx","../../src/aso/header.jsx","../../node_modules/he/he.js","../../src/aso/footer.jsx","../../src/redux/actionTypes.js","../../src/redux/reducer.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/canUseDOM.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/classNames.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/getTabIndex.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/guid.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/keys.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/validate-package.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/hooks/useMouse.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/constants.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/Icon.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/SvgIcon.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/IconsContext.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/IconWrap.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/icons/utils.js","../../node_modules/@progress/kendo-react-upload/node_modules/@progress/kendo-react-common/dist/es/getActiveElement.js","../../node_modules/@progress/kendo-react-upload/dist/es/interfaces/UploadFileStatus.js","../../node_modules/@progress/kendo-react-upload/dist/es/messages/index.js","../../node_modules/@progress/kendo-react-upload/dist/es/utils/utils.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadListActionButton.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadListSingleItem.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadListMultiItem.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadListGroup.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadList.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadInput.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadAddButton.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadActionButtons.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadStatus.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadDropZone.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadUI.js","../../node_modules/@progress/kendo-react-upload/dist/es/UploadNavigation.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/bind.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/utils.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/AxiosError.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/null.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/toFormData.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/buildURL.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/defaults/transitional.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/platform/browser/index.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/defaults/index.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/transformData.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/cancel/isCancel.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/settle.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/cookies.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/buildFullPath.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/speedometer.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/adapters/xhr.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/adapters/adapters.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/mergeConfig.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/env/data.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/validator.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/core/Axios.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/spread.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/lib/axios.js","../../node_modules/@progress/kendo-react-upload/node_modules/axios/index.js","../../node_modules/@progress/kendo-react-upload/dist/es/utils/stateUtils.js","../../node_modules/@progress/kendo-react-upload/dist/es/utils/connectionUtils.js","../../node_modules/@progress/kendo-react-upload/dist/es/utils/validationUtils.js","../../node_modules/@progress/kendo-react-upload/dist/es/package-metadata.js","../../node_modules/@progress/kendo-react-upload/dist/es/Upload.js","../../src/aso/shared/UniteUploadA11y.jsx","../../src/aso/DocumentUpload.jsx","../../src/aso/aso.jsx","../../node_modules/@azure/msal-react/dist/MsalContext.js","../../node_modules/@azure/msal-react/dist/utils/utilities.js","../../node_modules/@azure/msal-react/dist/packageMetadata.js","../../node_modules/@azure/msal-react/dist/MsalProvider.js","../../node_modules/@azure/msal-react/dist/hooks/useMsal.js","../../node_modules/@azure/msal-react/dist/hooks/useIsAuthenticated.js","../../node_modules/@azure/msal-react/dist/hooks/useAccount.js","../../node_modules/@azure/msal-react/dist/error/ReactAuthError.js","../../node_modules/@azure/msal-react/dist/hooks/useMsalAuthentication.js","../../node_modules/@azure/msal-react/dist/components/MsalAuthenticationTemplate.js","../../src/aso/AsoCandidate.jsx","../../src/aso/AsoUnite.jsx","../../src/App.jsx","../../node_modules/@nevware21/ts-utils/dist/es5/mod/ts-utils.js","../../node_modules/@microsoft/dynamicproto-js/dist-es5/DynamicProto.js","../../node_modules/@microsoft/applicationinsights-shims/dist-es5/Constants.js","../../node_modules/@microsoft/applicationinsights-shims/dist-es5/TsLibShims.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK.Enums/EnumHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AggregationError.js","../../node_modules/@nevware21/ts-async/dist/es5/mod/ts-async.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/HelperFuncs.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EnvUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/RandomHelper.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DataCacheHelper.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaults.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicSupport.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicProperty.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicState.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicConfig.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AsyncUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/Constants.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaultHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DbgExtensionUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DiagnosticLogger.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/CookieMgr.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/NotificationManager.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/PerfManager.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/CoreUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/W3cTraceParent.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHookContainer.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryInitializerPlugin.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AppInsightsCore.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ResponseHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/SenderPostManager.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EventHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InstrumentHooks.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Constants.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/RequestResponseHeaders.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/DataSanitizer.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/UrlHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Util.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Enums.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/StorageHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/ThrottleMgr.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/ConnectionStringParser.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/Envelope.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Event.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Exception.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/DataPoint.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Metric.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/HelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/PageView.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/RemoteDependencyData.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Trace.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/PageViewPerformance.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Telemetry/Common/Data.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Interfaces/Contracts/SeverityLevel.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Interfaces/Contracts/ContextTagKeys.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/TelemetryItemCreator.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Interfaces/PartAExtensions.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/DomHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/Offline.js","../../node_modules/@microsoft/applicationinsights-common/dist-es5/applicationinsights-common.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageViewManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/Timing.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-es5/JavaScriptSDK/AnalyticsPlugin.js","../../node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/CfgSyncHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-cfgsync-js/dist-es5/CfgSyncPlugin.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/EnvelopeCreator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/SendBuffer.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/Serializer.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/TelemetryProcessors/Sample.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-es5/Sender.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/ajaxRecord.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-es5/ajax.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Application.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Device.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Internal.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Location.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/Session.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/TelemetryTrace.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/Context/User.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/TelemetryContext.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-es5/PropertiesPlugin.js","../../node_modules/@microsoft/applicationinsights-web/dist-es5/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-web/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-web/dist-es5/AISku.js","../../node_modules/@microsoft/applicationinsights-react-js/dist-esm/ReactPlugin.js","../../node_modules/@microsoft/applicationinsights-react-js/dist-esm/AppInsightsErrorBoundary.js","../../node_modules/history/index.js","../../src/appInsights.js","../../src/images/LSAC-Logo-Product-Unite-outlines-400x50.png","../../node_modules/immer/dist/immer.esm.mjs","../../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/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/redux/es/redux.js","../../node_modules/redux-thunk/es/index.js","../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js","../../src/redux/store.js","../../src/index.jsx"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v17.0.2\n * react.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 l=require(\"object-assign\"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;\nif(\"function\"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w(\"react.element\");p=w(\"react.portal\");exports.Fragment=w(\"react.fragment\");exports.StrictMode=w(\"react.strict_mode\");exports.Profiler=w(\"react.profiler\");q=w(\"react.provider\");r=w(\"react.context\");t=w(\"react.forward_ref\");exports.Suspense=w(\"react.suspense\");u=w(\"react.memo\");v=w(\"react.lazy\")}var x=\"function\"===typeof Symbol&&Symbol.iterator;\nfunction y(a){if(null===a||\"object\"!==typeof a)return null;a=x&&a[x]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function z(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M)}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else{var b=J(M);null!==b&&g(U,b.startTime-a)}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\"function\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b)}else K(L);O=J(L)}if(null!==O)var m=!0;else{var n=J(M);null!==n&&g(U,n.startTime-b);m=!1}return m}finally{O=null,P=c,Q=!1}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V))};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\"object\"===typeof c&&null!==c?(c=c.delay,c=\"number\"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/** @license React v17.0.2\n * react-dom.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/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),m=require(\"object-assign\"),r=require(\"scheduler\");function y(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var D={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1)});var oa=/[\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1)});\nD.xlinkHref=new B(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2h||e[g]!==f[h])return\"\\n\"+e[g].replace(\" at new \",\" at \");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Na(a):\"\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\"Lazy\");case 13:return Na(\"Suspense\");case 19:return Na(\"SuspenseList\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return\"\"}}\nfunction Ra(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ua:return\"Fragment\";case ta:return\"Portal\";case xa:return\"Profiler\";case wa:return\"StrictMode\";case Ba:return\"Suspense\";case Ca:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case za:return(a.displayName||\"Context\")+\".Consumer\";case ya:return(a._context.displayName||\"Context\")+\".Provider\";case Aa:var b=a.render;b=b.displayName||b.name||\"\";\nreturn a.displayName||(\"\"!==b?\"ForwardRef(\"+b+\")\":\"ForwardRef\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"object\":case \"string\":case \"undefined\":return a;default:return\"\"}}function Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return m({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function $a(a,b){b=b.checked;null!=b&&qa(a,\"checked\",b,!1)}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?bb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction cb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction bb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}function db(a){var b=\"\";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function eb(a,b){a=m({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=c.length))throw Error(y(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:Sa(c)}}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var kb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction lb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function mb(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?lb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar nb,ob=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\"innerHTML\"in a)a.innerHTML=b;else{nb=nb||document.createElement(\"div\");nb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a]})});function sb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\"\"+b).trim():b+\"px\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=sb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var ub=m({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;ad?0:1<c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=r.unstable_UserBlockingPriority,ed=r.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d)}finally{(Kb=f)||Mb()}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d))}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ke(c)}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nvar Pe=fa&&\"documentMode\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Af||(a.current=zf[Af],zf[Af]=null,Af--)}function I(a,b){Af++;zf[Af]=a.current;a.current=b}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M)}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c)}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\"Unknown\",e));return m({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return!0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c)}\nvar Lf=null,Mf=null,Nf=r.unstable_runWithPriority,Of=r.unstable_scheduleCallback,Pf=r.unstable_cancelCallback,Qf=r.unstable_shouldYield,Rf=r.unstable_requestPaint,Sf=r.unstable_now,Tf=r.unstable_getCurrentPriorityLevel,Uf=r.unstable_ImmediatePriority,Vf=r.unstable_UserBlockingPriority,Wf=r.unstable_NormalPriority,Xf=r.unstable_LowPriority,Yf=r.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a)}jg()}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;az?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q}if(z===h.length)return c(e,u),l;if(null===u){for(;zz?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h)}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=\nWg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\"Component\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a)}H(ah);I(ah,b)}function fh(){H(ah);H(bh);H(ch)}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c))}function hh(a){bh.current===a&&(H(ah),H(bh))}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c)}jh=a;kh=rf(b.firstChild)}else a.flags=a.flags&-1025|2,lh=!1,jh=a}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a}\nfunction rh(a){if(a!==jh)return!1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\"/$\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--}else\"$\"!==c&&\"$!\"!==c&&\"$?\"!==c||b++}a=a.nextSibling}kh=null}}else kh=jh?rf(a.stateNode.nextSibling):null;return!0}\nfunction sh(){kh=jh=null;lh=!1}var th=[];function uh(){for(var a=0;af))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e)}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else{if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a}return T}function Jh(a,b){return\"function\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else{var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l}k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0c?98:c,function(){a(!0)});gg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \"dialog\":G(\"cancel\",a);G(\"close\",a);\ne=d;break;case \"iframe\":case \"object\":case \"embed\":G(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eJi&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432)}else{if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\"hidden\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g)}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\"unstable-defer-without-hiding\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\"\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c}catch(f){e=\"\\nError generating stack: \"+f.message+\"\\n\"+f.stack}return{value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Oi=\"function\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b)};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\"function\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)}}var f=a.stateNode;null!==f&&\"function\"===typeof f.componentDidCatch&&(c.callback=function(){\"function\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\"\"})});return c}var Ui=\"function\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\"function\"===typeof b)try{b(null)}catch(c){Wi(a,c)}else b.current=null}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d()}a=a.next}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}Eg(c,b,a)}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\"function\"===typeof d.setProperty?d.setProperty(\"display\",\"none\",\"important\"):d.display=\"none\";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\"display\")?e.display:null;d.style.display=sb(\"display\",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?\"\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}\nfunction bj(a,b){if(Mf&&\"function\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b)}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else{d=b;try{e()}catch(f){Wi(d,f)}}c=c.next}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\"function\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(f){Wi(b,\nf)}break;case 5:Vi(b);break;case 4:cj(a,b)}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\"\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b)}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return}d=!0}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else{if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return}k.sibling.return=k.return;k=k.sibling}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode)}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c=c.sibling}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\"input\"===a&&\"radio\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;ee&&(e=g);c&=~f}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10 component higher in the tree to provide a loading indicator or placeholder to display.\")}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\"function\"===typeof K.getDerivedStateFromError||null!==Q&&\"function\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return}while(null!==p)}Zj(c)}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e)}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y)}function Rj(){for(;null!==Y&&!Qf();)bk(Y)}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\"function\"===typeof t.focus&&t.focus();for(t=\n0;tO()-jj?Qj(a,0):uj|=c);Mj(a,b)}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c))}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else{ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\"object\"===\ntypeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c)}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else{e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = prefix || defaultDelimiter\n var pattern = capture || group\n var prevText = prefix || (typeof tokens[tokens.length - 1] === 'string' ? tokens[tokens.length - 1] : '')\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : restrictBacktrack(delimiter, prevText))\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\nfunction restrictBacktrack(delimiter, prevText) {\n if (!prevText || prevText.indexOf(delimiter) > -1) {\n return '[^' + escapeString(delimiter) + ']+?'\n }\n\n return escapeString(prevText) + '|(?:(?!' + escapeString(prevText) + ')[^' + escapeString(delimiter) + '])+?'\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","/** @license React v16.13.1\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\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport pathToRegexp from 'path-to-regexp';\nimport { isValidElementType } from 'react-is';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport hoistStatics from 'hoist-non-react-statics';\n\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\nvar commonjsGlobal = typeof globalThis !== \"undefined\" // 'global proper'\n? // eslint-disable-next-line no-undef\nglobalThis : typeof window !== \"undefined\" ? window // Browser\n: typeof global !== \"undefined\" ? global // node.js\n: {};\n\nfunction getUniqueId() {\n var key = \"__global_unique_id__\";\n return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;\n} // Inlined Object.is polyfill.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n\n\nfunction objectIs(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // eslint-disable-next-line no-self-compare\n return x !== x && y !== y;\n }\n}\n\nfunction createEventEmitter(value) {\n var handlers = [];\n return {\n on: function on(handler) {\n handlers.push(handler);\n },\n off: function off(handler) {\n handlers = handlers.filter(function (h) {\n return h !== handler;\n });\n },\n get: function get() {\n return value;\n },\n set: function set(newValue, changedBits) {\n value = newValue;\n handlers.forEach(function (handler) {\n return handler(value, changedBits);\n });\n }\n };\n}\n\nfunction onlyChild(children) {\n return Array.isArray(children) ? children[0] : children;\n}\n\nfunction createReactContext(defaultValue, calculateChangedBits) {\n var _Provider$childContex, _Consumer$contextType;\n\n var contextProp = \"__create-react-context-\" + getUniqueId() + \"__\";\n\n var Provider = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Provider, _React$Component);\n\n function Provider() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.emitter = createEventEmitter(_this.props.value);\n return _this;\n }\n\n var _proto = Provider.prototype;\n\n _proto.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[contextProp] = this.emitter, _ref;\n };\n\n _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (this.props.value !== nextProps.value) {\n var oldValue = this.props.value;\n var newValue = nextProps.value;\n var changedBits;\n\n if (objectIs(oldValue, newValue)) {\n changedBits = 0; // No change\n } else {\n changedBits = typeof calculateChangedBits === \"function\" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, \"calculateChangedBits: Expected the return value to be a \" + \"31-bit integer. Instead received: \" + changedBits) : void 0;\n }\n\n changedBits |= 0;\n\n if (changedBits !== 0) {\n this.emitter.set(nextProps.value, changedBits);\n }\n }\n }\n };\n\n _proto.render = function render() {\n return this.props.children;\n };\n\n return Provider;\n }(React.Component);\n\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);\n\n var Consumer = /*#__PURE__*/function (_React$Component2) {\n _inheritsLoose(Consumer, _React$Component2);\n\n function Consumer() {\n var _this2;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;\n _this2.observedBits = void 0;\n _this2.state = {\n value: _this2.getValue()\n };\n\n _this2.onUpdate = function (newValue, changedBits) {\n var observedBits = _this2.observedBits | 0;\n\n if ((observedBits & changedBits) !== 0) {\n _this2.setState({\n value: _this2.getValue()\n });\n }\n };\n\n return _this2;\n }\n\n var _proto2 = Consumer.prototype;\n\n _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var observedBits = nextProps.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n _proto2.componentDidMount = function componentDidMount() {\n if (this.context[contextProp]) {\n this.context[contextProp].on(this.onUpdate);\n }\n\n var observedBits = this.props.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n _proto2.componentWillUnmount = function componentWillUnmount() {\n if (this.context[contextProp]) {\n this.context[contextProp].off(this.onUpdate);\n }\n };\n\n _proto2.getValue = function getValue() {\n if (this.context[contextProp]) {\n return this.context[contextProp].get();\n } else {\n return defaultValue;\n }\n };\n\n _proto2.render = function render() {\n return onlyChild(this.props.children)(this.state.value);\n };\n\n return Consumer;\n }(React.Component);\n\n Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);\n return {\n Provider: Provider,\n Consumer: Consumer\n };\n}\n\n// MIT License\nvar createContext = React.createContext || createReactContext;\n\n// TODO: Replace with React.createContext once we can assume React 16+\n\nvar createNamedContext = function createNamedContext(name) {\n var context = createContext();\n context.displayName = name;\n return context;\n};\n\nvar historyContext = /*#__PURE__*/createNamedContext(\"Router-History\");\n\nvar context = /*#__PURE__*/createNamedContext(\"Router\");\n\n/**\n * The public API for putting history on context.\n */\n\nvar Router = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Router, _React$Component);\n\n Router.computeRootMatch = function computeRootMatch(pathname) {\n return {\n path: \"/\",\n url: \"/\",\n params: {},\n isExact: pathname === \"/\"\n };\n };\n\n function Router(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n location: props.history.location\n }; // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the is mounted.\n\n _this._isMounted = false;\n _this._pendingLocation = null;\n\n if (!props.staticContext) {\n _this.unlisten = props.history.listen(function (location) {\n _this._pendingLocation = location;\n });\n }\n\n return _this;\n }\n\n var _proto = Router.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n this._isMounted = true;\n\n if (this.unlisten) {\n // Any pre-mount location changes have been captured at\n // this point, so unregister the listener.\n this.unlisten();\n }\n\n if (!this.props.staticContext) {\n this.unlisten = this.props.history.listen(function (location) {\n if (_this2._isMounted) {\n _this2.setState({\n location: location\n });\n }\n });\n }\n\n if (this._pendingLocation) {\n this.setState({\n location: this._pendingLocation\n });\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.unlisten) {\n this.unlisten();\n this._isMounted = false;\n this._pendingLocation = null;\n }\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(context.Provider, {\n value: {\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }\n }, /*#__PURE__*/React.createElement(historyContext.Provider, {\n children: this.props.children || null,\n value: this.props.history\n }));\n };\n\n return Router;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(prevProps.history === this.props.history, \"You cannot change \") : void 0;\n };\n}\n\n/**\n * The public API for a that stores location in memory.\n */\n\nvar MemoryRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(MemoryRouter, _React$Component);\n\n function MemoryRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createMemoryHistory(_this.props);\n return _this;\n }\n\n var _proto = MemoryRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return MemoryRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\") : void 0;\n };\n}\n\nvar Lifecycle = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Lifecycle, _React$Component);\n\n function Lifecycle() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Lifecycle.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n };\n\n _proto.render = function render() {\n return null;\n };\n\n return Lifecycle;\n}(React.Component);\n\n/**\n * The public API for prompting the user before navigating away from a screen.\n */\n\nfunction Prompt(_ref) {\n var message = _ref.message,\n _ref$when = _ref.when,\n when = _ref$when === void 0 ? true : _ref$when;\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n if (!when || context.staticContext) return null;\n var method = context.history.block;\n return /*#__PURE__*/React.createElement(Lifecycle, {\n onMount: function onMount(self) {\n self.release = method(message);\n },\n onUpdate: function onUpdate(self, prevProps) {\n if (prevProps.message !== message) {\n self.release();\n self.release = method(message);\n }\n },\n onUnmount: function onUnmount(self) {\n self.release();\n },\n message: message\n });\n });\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);\n Prompt.propTypes = {\n when: PropTypes.bool,\n message: messageType.isRequired\n };\n}\n\nvar cache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n var generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\n\n\nfunction generatePath(path, params) {\n if (path === void 0) {\n path = \"/\";\n }\n\n if (params === void 0) {\n params = {};\n }\n\n return path === \"/\" ? path : compilePath(path)(params, {\n pretty: true\n });\n}\n\n/**\n * The public API for navigating programmatically with a component.\n */\n\nfunction Redirect(_ref) {\n var computedMatch = _ref.computedMatch,\n to = _ref.to,\n _ref$push = _ref.push,\n push = _ref$push === void 0 ? false : _ref$push;\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n var history = context.history,\n staticContext = context.staticContext;\n var method = push ? history.push : history.replace;\n var location = createLocation(computedMatch ? typeof to === \"string\" ? generatePath(to, computedMatch.params) : _extends({}, to, {\n pathname: generatePath(to.pathname, computedMatch.params)\n }) : to); // When rendering in a static context,\n // set the new location immediately.\n\n if (staticContext) {\n method(location);\n return null;\n }\n\n return /*#__PURE__*/React.createElement(Lifecycle, {\n onMount: function onMount() {\n method(location);\n },\n onUpdate: function onUpdate(self, prevProps) {\n var prevLocation = createLocation(prevProps.to);\n\n if (!locationsAreEqual(prevLocation, _extends({}, location, {\n key: prevLocation.key\n }))) {\n method(location);\n }\n },\n to: to\n });\n });\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nvar cache$1 = {};\nvar cacheLimit$1 = 10000;\nvar cacheCount$1 = 0;\n\nfunction compilePath$1(path, options) {\n var cacheKey = \"\" + options.end + options.strict + options.sensitive;\n var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});\n if (pathCache[path]) return pathCache[path];\n var keys = [];\n var regexp = pathToRegexp(path, keys, options);\n var result = {\n regexp: regexp,\n keys: keys\n };\n\n if (cacheCount$1 < cacheLimit$1) {\n pathCache[path] = result;\n cacheCount$1++;\n }\n\n return result;\n}\n/**\n * Public API for matching a URL pathname to a path.\n */\n\n\nfunction matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = {\n path: options\n };\n }\n\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n var value = children(props);\n process.env.NODE_ENV !== \"production\" ? warning(value !== undefined, \"You returned `undefined` from the `children` function of \" + (\", but you \") + \"should have returned a React element or `null`\") : void 0;\n return value || null;\n}\n/**\n * The public API for matching a single path and rendering.\n */\n\n\nvar Route = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Route, _React$Component);\n\n function Route() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Route.prototype;\n\n _proto.render = function render() {\n var _this = this;\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context$1) {\n !context$1 ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n var location = _this.props.location || context$1.location;\n var match = _this.props.computedMatch ? _this.props.computedMatch // already computed the match for us\n : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;\n\n var props = _extends({}, context$1, {\n location: location,\n match: match\n });\n\n var _this$props = _this.props,\n children = _this$props.children,\n component = _this$props.component,\n render = _this$props.render; // Preact uses an empty array as children by\n // default, so use null if that's the case.\n\n if (Array.isArray(children) && isEmptyChildren(children)) {\n children = null;\n }\n\n return /*#__PURE__*/React.createElement(context.Provider, {\n value: props\n }, props.match ? children ? typeof children === \"function\" ? process.env.NODE_ENV !== \"production\" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? /*#__PURE__*/React.createElement(component, props) : render ? render(props) : null : typeof children === \"function\" ? process.env.NODE_ENV !== \"production\" ? evalChildrenDev(children, props, _this.props.path) : children(props) : null);\n });\n };\n\n return Route;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: function component(props, propName) {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\"Invalid prop 'component' supplied to 'Route': the prop is not a valid React component\");\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), \"You should not use and in the same route; will be ignored\") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), \"You should not use and in the same route; will be ignored\") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.component && this.props.render), \"You should not use and in the same route; will be ignored\") : void 0;\n };\n\n Route.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.') : void 0;\n };\n}\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n return _extends({}, location, {\n pathname: addLeadingSlash(basename) + location.pathname\n });\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n var base = addLeadingSlash(basename);\n if (location.pathname.indexOf(base) !== 0) return location;\n return _extends({}, location, {\n pathname: location.pathname.substr(base.length)\n });\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return function () {\n process.env.NODE_ENV !== \"production\" ? invariant(false, \"You cannot %s with \", methodName) : invariant(false) ;\n };\n}\n\nfunction noop() {}\n/**\n * The public top-level API for a \"static\" , so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\n\n\nvar StaticRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(StaticRouter, _React$Component);\n\n function StaticRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handlePush = function (location) {\n return _this.navigateTo(location, \"PUSH\");\n };\n\n _this.handleReplace = function (location) {\n return _this.navigateTo(location, \"REPLACE\");\n };\n\n _this.handleListen = function () {\n return noop;\n };\n\n _this.handleBlock = function () {\n return noop;\n };\n\n return _this;\n }\n\n var _proto = StaticRouter.prototype;\n\n _proto.navigateTo = function navigateTo(location, action) {\n var _this$props = this.props,\n _this$props$basename = _this$props.basename,\n basename = _this$props$basename === void 0 ? \"\" : _this$props$basename,\n _this$props$context = _this$props.context,\n context = _this$props$context === void 0 ? {} : _this$props$context;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n _this$props2$basename = _this$props2.basename,\n basename = _this$props2$basename === void 0 ? \"\" : _this$props2$basename,\n _this$props2$context = _this$props2.context,\n context = _this$props2$context === void 0 ? {} : _this$props2$context,\n _this$props2$location = _this$props2.location,\n location = _this$props2$location === void 0 ? \"/\" : _this$props2$location,\n rest = _objectWithoutPropertiesLoose(_this$props2, [\"basename\", \"context\", \"location\"]);\n\n var history = {\n createHref: function createHref(path) {\n return addLeadingSlash(basename + createURL(path));\n },\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n return /*#__PURE__*/React.createElement(Router, _extends({}, rest, {\n history: history,\n staticContext: context\n }));\n };\n\n return StaticRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { StaticRouter as Router }`.\") : void 0;\n };\n}\n\n/**\n * The public API for rendering the first that matches.\n */\n\nvar Switch = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Switch, _React$Component);\n\n function Switch() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Switch.prototype;\n\n _proto.render = function render() {\n var _this = this;\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n var location = _this.props.location || context.location;\n var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two s that render the same\n // component at different URLs.\n\n React.Children.forEach(_this.props.children, function (child) {\n if (match == null && /*#__PURE__*/React.isValidElement(child)) {\n element = child;\n var path = child.props.path || child.props.from;\n match = path ? matchPath(location.pathname, _extends({}, child.props, {\n path: path\n })) : context.match;\n }\n });\n return match ? /*#__PURE__*/React.cloneElement(element, {\n location: location,\n computedMatch: match\n }) : null;\n });\n };\n\n return Switch;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.') : void 0;\n };\n}\n\n/**\n * A public higher-order component to access the imperative API\n */\n\nfunction withRouter(Component) {\n var displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutPropertiesLoose(props, [\"wrappedComponentRef\"]);\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <\" + displayName + \" /> outside a \") : invariant(false) : void 0;\n return /*#__PURE__*/React.createElement(Component, _extends({}, remainingProps, context, {\n ref: wrappedComponentRef\n }));\n });\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (process.env.NODE_ENV !== \"production\") {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nvar useContext = React.useContext;\nfunction useHistory() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useHistory()\") : invariant(false) : void 0;\n }\n\n return useContext(historyContext);\n}\nfunction useLocation() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useLocation()\") : invariant(false) : void 0;\n }\n\n return useContext(context).location;\n}\nfunction useParams() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useParams()\") : invariant(false) : void 0;\n }\n\n var match = useContext(context).match;\n return match ? match.params : {};\n}\nfunction useRouteMatch(path) {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useRouteMatch()\") : invariant(false) : void 0;\n }\n\n var location = useLocation();\n var match = useContext(context).match;\n return path ? matchPath(location.pathname, path) : match;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== \"undefined\") {\n var global$1 = window;\n var key = \"__react_router_build__\";\n var buildNames = {\n cjs: \"CommonJS\",\n esm: \"ES modules\",\n umd: \"UMD\"\n };\n\n if (global$1[key] && global$1[key] !== \"esm\") {\n var initialBuildName = buildNames[global$1[key]];\n var secondaryBuildName = buildNames[\"esm\"]; // TODO: Add link to article that explains in detail how to avoid\n // loading 2 different builds.\n\n throw new Error(\"You are loading the \" + secondaryBuildName + \" build of React Router \" + (\"on a page that is already running the \" + initialBuildName + \" \") + \"build, so things won't work right.\");\n }\n\n global$1[key] = \"esm\";\n }\n}\n\nexport { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, historyContext as __HistoryContext, context as __RouterContext, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter };\n//# sourceMappingURL=react-router.js.map\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","import { Router, __RouterContext, matchPath } from 'react-router';\nexport { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter } from 'react-router';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport React from 'react';\nimport { createBrowserHistory, createHashHistory, createLocation, createPath } from 'history';\nimport PropTypes from 'prop-types';\nimport warning from 'tiny-warning';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport invariant from 'tiny-invariant';\n\n/**\n * The public API for a that uses HTML5 history.\n */\n\nvar BrowserRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(BrowserRouter, _React$Component);\n\n function BrowserRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createBrowserHistory(_this.props);\n return _this;\n }\n\n var _proto = BrowserRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return BrowserRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\") : void 0;\n };\n}\n\n/**\n * The public API for a that uses window.location.hash.\n */\n\nvar HashRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(HashRouter, _React$Component);\n\n function HashRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createHashHistory(_this.props);\n return _this;\n }\n\n var _proto = HashRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return HashRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \" ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { HashRouter as Router }`.\") : void 0;\n };\n}\n\nvar resolveToLocation = function resolveToLocation(to, currentLocation) {\n return typeof to === \"function\" ? to(currentLocation) : to;\n};\nvar normalizeToLocation = function normalizeToLocation(to, currentLocation) {\n return typeof to === \"string\" ? createLocation(to, null, null, currentLocation) : to;\n};\n\nvar forwardRefShim = function forwardRefShim(C) {\n return C;\n};\n\nvar forwardRef = React.forwardRef;\n\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nvar LinkAnchor = forwardRef(function (_ref, forwardedRef) {\n var innerRef = _ref.innerRef,\n navigate = _ref.navigate,\n _onClick = _ref.onClick,\n rest = _objectWithoutPropertiesLoose(_ref, [\"innerRef\", \"navigate\", \"onClick\"]);\n\n var target = rest.target;\n\n var props = _extends({}, rest, {\n onClick: function onClick(event) {\n try {\n if (_onClick) _onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (!event.defaultPrevented && // onClick prevented default\n event.button === 0 && ( // ignore everything but left clicks\n !target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n }); // React 15 compat\n\n\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n\n\n return /*#__PURE__*/React.createElement(\"a\", props);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n/**\n * The public API for rendering a history-aware .\n */\n\n\nvar Link = forwardRef(function (_ref2, forwardedRef) {\n var _ref2$component = _ref2.component,\n component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,\n replace = _ref2.replace,\n to = _ref2.to,\n innerRef = _ref2.innerRef,\n rest = _objectWithoutPropertiesLoose(_ref2, [\"component\", \"replace\", \"to\", \"innerRef\"]);\n\n return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n var history = context.history;\n var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);\n var href = location ? history.createHref(location) : \"\";\n\n var props = _extends({}, rest, {\n href: href,\n navigate: function navigate() {\n var location = resolveToLocation(to, context.location);\n var isDuplicateNavigation = createPath(context.location) === createPath(normalizeToLocation(location));\n var method = replace || isDuplicateNavigation ? history.replace : history.push;\n method(location);\n }\n }); // React 15 compat\n\n\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return /*#__PURE__*/React.createElement(component, props);\n });\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]);\n var refType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({\n current: PropTypes.any\n })]);\n Link.displayName = \"Link\";\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nvar forwardRefShim$1 = function forwardRefShim(C) {\n return C;\n};\n\nvar forwardRef$1 = React.forwardRef;\n\nif (typeof forwardRef$1 === \"undefined\") {\n forwardRef$1 = forwardRefShim$1;\n}\n\nfunction joinClassnames() {\n for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {\n classnames[_key] = arguments[_key];\n }\n\n return classnames.filter(function (i) {\n return i;\n }).join(\" \");\n}\n/**\n * A wrapper that knows if it's \"active\" or not.\n */\n\n\nvar NavLink = forwardRef$1(function (_ref, forwardedRef) {\n var _ref$ariaCurrent = _ref[\"aria-current\"],\n ariaCurrent = _ref$ariaCurrent === void 0 ? \"page\" : _ref$ariaCurrent,\n _ref$activeClassName = _ref.activeClassName,\n activeClassName = _ref$activeClassName === void 0 ? \"active\" : _ref$activeClassName,\n activeStyle = _ref.activeStyle,\n classNameProp = _ref.className,\n exact = _ref.exact,\n isActiveProp = _ref.isActive,\n locationProp = _ref.location,\n sensitive = _ref.sensitive,\n strict = _ref.strict,\n styleProp = _ref.style,\n to = _ref.to,\n innerRef = _ref.innerRef,\n rest = _objectWithoutPropertiesLoose(_ref, [\"aria-current\", \"activeClassName\", \"activeStyle\", \"className\", \"exact\", \"isActive\", \"location\", \"sensitive\", \"strict\", \"style\", \"to\", \"innerRef\"]);\n\n return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use outside a \") : invariant(false) : void 0;\n var currentLocation = locationProp || context.location;\n var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);\n var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n\n var escapedPath = path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n var match = escapedPath ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact: exact,\n sensitive: sensitive,\n strict: strict\n }) : null;\n var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);\n var className = typeof classNameProp === \"function\" ? classNameProp(isActive) : classNameProp;\n var style = typeof styleProp === \"function\" ? styleProp(isActive) : styleProp;\n\n if (isActive) {\n className = joinClassnames(className, activeClassName);\n style = _extends({}, style, activeStyle);\n }\n\n var props = _extends({\n \"aria-current\": isActive && ariaCurrent || null,\n className: className,\n style: style,\n to: toLocation\n }, rest); // React 15 compat\n\n\n if (forwardRefShim$1 !== forwardRef$1) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return /*#__PURE__*/React.createElement(Link, props);\n });\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n NavLink.displayName = \"NavLink\";\n var ariaCurrentType = PropTypes.oneOf([\"page\", \"step\", \"location\", \"date\", \"time\", \"true\", \"false\"]);\n NavLink.propTypes = _extends({}, Link.propTypes, {\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n });\n}\n\nexport { BrowserRouter, HashRouter, Link, NavLink };\n//# sourceMappingURL=react-router-dom.js.map\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap\n};\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils.isBlob(body)) {\n return body.size;\n }\n\n if(utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n}\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n}\n\nexport default isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\n\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.8.4\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst Constants = {\r\n LIBRARY_NAME: \"MSAL.JS\",\r\n SKU: \"msal.js.common\",\r\n // Prefix for all library cache entries\r\n CACHE_PREFIX: \"msal\",\r\n // default authority\r\n DEFAULT_AUTHORITY: \"https://login.microsoftonline.com/common/\",\r\n DEFAULT_AUTHORITY_HOST: \"login.microsoftonline.com\",\r\n DEFAULT_COMMON_TENANT: \"common\",\r\n // ADFS String\r\n ADFS: \"adfs\",\r\n DSTS: \"dstsv2\",\r\n // Default AAD Instance Discovery Endpoint\r\n AAD_INSTANCE_DISCOVERY_ENDPT: \"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=\",\r\n // CIAM URL\r\n CIAM_AUTH_URL: \".ciamlogin.com\",\r\n AAD_TENANT_DOMAIN_SUFFIX: \".onmicrosoft.com\",\r\n // Resource delimiter - used for certain cache entries\r\n RESOURCE_DELIM: \"|\",\r\n // Placeholder for non-existent account ids/objects\r\n NO_ACCOUNT: \"NO_ACCOUNT\",\r\n // Claims\r\n CLAIMS: \"claims\",\r\n // Consumer UTID\r\n CONSUMER_UTID: \"9188040d-6c67-4c5b-b112-36a304b66dad\",\r\n // Default scopes\r\n OPENID_SCOPE: \"openid\",\r\n PROFILE_SCOPE: \"profile\",\r\n OFFLINE_ACCESS_SCOPE: \"offline_access\",\r\n EMAIL_SCOPE: \"email\",\r\n // Default response type for authorization code flow\r\n CODE_RESPONSE_TYPE: \"code\",\r\n CODE_GRANT_TYPE: \"authorization_code\",\r\n RT_GRANT_TYPE: \"refresh_token\",\r\n FRAGMENT_RESPONSE_MODE: \"fragment\",\r\n S256_CODE_CHALLENGE_METHOD: \"S256\",\r\n URL_FORM_CONTENT_TYPE: \"application/x-www-form-urlencoded;charset=utf-8\",\r\n AUTHORIZATION_PENDING: \"authorization_pending\",\r\n NOT_DEFINED: \"not_defined\",\r\n EMPTY_STRING: \"\",\r\n NOT_APPLICABLE: \"N/A\",\r\n NOT_AVAILABLE: \"Not Available\",\r\n FORWARD_SLASH: \"/\",\r\n IMDS_ENDPOINT: \"http://169.254.169.254/metadata/instance/compute/location\",\r\n IMDS_VERSION: \"2020-06-01\",\r\n IMDS_TIMEOUT: 2000,\r\n AZURE_REGION_AUTO_DISCOVER_FLAG: \"TryAutoDetect\",\r\n REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: \"login.microsoft.com\",\r\n KNOWN_PUBLIC_CLOUDS: [\r\n \"login.microsoftonline.com\",\r\n \"login.windows.net\",\r\n \"login.microsoft.com\",\r\n \"sts.windows.net\",\r\n ],\r\n TOKEN_RESPONSE_TYPE: \"token\",\r\n ID_TOKEN_RESPONSE_TYPE: \"id_token\",\r\n SHR_NONCE_VALIDITY: 240,\r\n INVALID_INSTANCE: \"invalid_instance\",\r\n};\r\nconst HttpStatus = {\r\n SUCCESS: 200,\r\n SUCCESS_RANGE_START: 200,\r\n SUCCESS_RANGE_END: 299,\r\n REDIRECT: 302,\r\n CLIENT_ERROR: 400,\r\n CLIENT_ERROR_RANGE_START: 400,\r\n BAD_REQUEST: 400,\r\n UNAUTHORIZED: 401,\r\n NOT_FOUND: 404,\r\n REQUEST_TIMEOUT: 408,\r\n TOO_MANY_REQUESTS: 429,\r\n CLIENT_ERROR_RANGE_END: 499,\r\n SERVER_ERROR: 500,\r\n SERVER_ERROR_RANGE_START: 500,\r\n SERVICE_UNAVAILABLE: 503,\r\n GATEWAY_TIMEOUT: 504,\r\n SERVER_ERROR_RANGE_END: 599,\r\n MULTI_SIDED_ERROR: 600,\r\n};\r\nconst OIDC_DEFAULT_SCOPES = [\r\n Constants.OPENID_SCOPE,\r\n Constants.PROFILE_SCOPE,\r\n Constants.OFFLINE_ACCESS_SCOPE,\r\n];\r\nconst OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, Constants.EMAIL_SCOPE];\r\n/**\r\n * Request header names\r\n */\r\nconst HeaderNames = {\r\n CONTENT_TYPE: \"Content-Type\",\r\n CONTENT_LENGTH: \"Content-Length\",\r\n RETRY_AFTER: \"Retry-After\",\r\n CCS_HEADER: \"X-AnchorMailbox\",\r\n WWWAuthenticate: \"WWW-Authenticate\",\r\n AuthenticationInfo: \"Authentication-Info\",\r\n X_MS_REQUEST_ID: \"x-ms-request-id\",\r\n X_MS_HTTP_VERSION: \"x-ms-httpver\",\r\n};\r\n/**\r\n * Persistent cache keys MSAL which stay while user is logged in.\r\n */\r\nconst PersistentCacheKeys = {\r\n ACTIVE_ACCOUNT_FILTERS: \"active-account-filters\", // new cache entry for active_account for a more robust version for browser\r\n};\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nconst AADAuthorityConstants = {\r\n COMMON: \"common\",\r\n ORGANIZATIONS: \"organizations\",\r\n CONSUMERS: \"consumers\",\r\n};\r\n/**\r\n * Claims request keys\r\n */\r\nconst ClaimsRequestKeys = {\r\n ACCESS_TOKEN: \"access_token\",\r\n XMS_CC: \"xms_cc\",\r\n};\r\n/**\r\n * we considered making this \"enum\" in the request instead of string, however it looks like the allowed list of\r\n * prompt values kept changing over past couple of years. There are some undocumented prompt values for some\r\n * internal partners too, hence the choice of generic \"string\" type instead of the \"enum\"\r\n */\r\nconst PromptValue = {\r\n LOGIN: \"login\",\r\n SELECT_ACCOUNT: \"select_account\",\r\n CONSENT: \"consent\",\r\n NONE: \"none\",\r\n CREATE: \"create\",\r\n NO_SESSION: \"no_session\",\r\n};\r\n/**\r\n * allowed values for codeVerifier\r\n */\r\nconst CodeChallengeMethodValues = {\r\n PLAIN: \"plain\",\r\n S256: \"S256\",\r\n};\r\n/**\r\n * allowed values for server response type\r\n */\r\nconst ServerResponseType = {\r\n QUERY: \"query\",\r\n FRAGMENT: \"fragment\",\r\n};\r\n/**\r\n * allowed values for response_mode\r\n */\r\nconst ResponseMode = {\r\n ...ServerResponseType,\r\n FORM_POST: \"form_post\",\r\n};\r\n/**\r\n * allowed grant_type\r\n */\r\nconst GrantType = {\r\n IMPLICIT_GRANT: \"implicit\",\r\n AUTHORIZATION_CODE_GRANT: \"authorization_code\",\r\n CLIENT_CREDENTIALS_GRANT: \"client_credentials\",\r\n RESOURCE_OWNER_PASSWORD_GRANT: \"password\",\r\n REFRESH_TOKEN_GRANT: \"refresh_token\",\r\n DEVICE_CODE_GRANT: \"device_code\",\r\n JWT_BEARER: \"urn:ietf:params:oauth:grant-type:jwt-bearer\",\r\n};\r\n/**\r\n * Account types in Cache\r\n */\r\nconst CacheAccountType = {\r\n MSSTS_ACCOUNT_TYPE: \"MSSTS\",\r\n ADFS_ACCOUNT_TYPE: \"ADFS\",\r\n MSAV1_ACCOUNT_TYPE: \"MSA\",\r\n GENERIC_ACCOUNT_TYPE: \"Generic\", // NTLM, Kerberos, FBA, Basic etc\r\n};\r\n/**\r\n * Separators used in cache\r\n */\r\nconst Separators = {\r\n CACHE_KEY_SEPARATOR: \"-\",\r\n CLIENT_INFO_SEPARATOR: \".\",\r\n};\r\n/**\r\n * Credential Type stored in the cache\r\n */\r\nconst CredentialType = {\r\n ID_TOKEN: \"IdToken\",\r\n ACCESS_TOKEN: \"AccessToken\",\r\n ACCESS_TOKEN_WITH_AUTH_SCHEME: \"AccessToken_With_AuthScheme\",\r\n REFRESH_TOKEN: \"RefreshToken\",\r\n};\r\n/**\r\n * Combine all cache types\r\n */\r\nconst CacheType = {\r\n ADFS: 1001,\r\n MSA: 1002,\r\n MSSTS: 1003,\r\n GENERIC: 1004,\r\n ACCESS_TOKEN: 2001,\r\n REFRESH_TOKEN: 2002,\r\n ID_TOKEN: 2003,\r\n APP_METADATA: 3001,\r\n UNDEFINED: 9999,\r\n};\r\n/**\r\n * More Cache related constants\r\n */\r\nconst APP_METADATA = \"appmetadata\";\r\nconst CLIENT_INFO = \"client_info\";\r\nconst THE_FAMILY_ID = \"1\";\r\nconst AUTHORITY_METADATA_CONSTANTS = {\r\n CACHE_KEY: \"authority-metadata\",\r\n REFRESH_TIME_SECONDS: 3600 * 24, // 24 Hours\r\n};\r\nconst AuthorityMetadataSource = {\r\n CONFIG: \"config\",\r\n CACHE: \"cache\",\r\n NETWORK: \"network\",\r\n HARDCODED_VALUES: \"hardcoded_values\",\r\n};\r\nconst SERVER_TELEM_CONSTANTS = {\r\n SCHEMA_VERSION: 5,\r\n MAX_CUR_HEADER_BYTES: 80,\r\n MAX_LAST_HEADER_BYTES: 330,\r\n MAX_CACHED_ERRORS: 50,\r\n CACHE_KEY: \"server-telemetry\",\r\n CATEGORY_SEPARATOR: \"|\",\r\n VALUE_SEPARATOR: \",\",\r\n OVERFLOW_TRUE: \"1\",\r\n OVERFLOW_FALSE: \"0\",\r\n UNKNOWN_ERROR: \"unknown_error\",\r\n};\r\n/**\r\n * Type of the authentication request\r\n */\r\nconst AuthenticationScheme = {\r\n BEARER: \"Bearer\",\r\n POP: \"pop\",\r\n SSH: \"ssh-cert\",\r\n};\r\n/**\r\n * Constants related to throttling\r\n */\r\nconst ThrottlingConstants = {\r\n // Default time to throttle RequestThumbprint in seconds\r\n DEFAULT_THROTTLE_TIME_SECONDS: 60,\r\n // Default maximum time to throttle in seconds, overrides what the server sends back\r\n DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,\r\n // Prefix for storing throttling entries\r\n THROTTLING_PREFIX: \"throttling\",\r\n // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling\r\n X_MS_LIB_CAPABILITY_VALUE: \"retry-after, h429\",\r\n};\r\nconst Errors = {\r\n INVALID_GRANT_ERROR: \"invalid_grant\",\r\n CLIENT_MISMATCH_ERROR: \"client_mismatch\",\r\n};\r\n/**\r\n * Password grant parameters\r\n */\r\nconst PasswordGrantConstants = {\r\n username: \"username\",\r\n password: \"password\",\r\n};\r\n/**\r\n * Response codes\r\n */\r\nconst ResponseCodes = {\r\n httpSuccess: 200,\r\n httpBadRequest: 400,\r\n};\r\n/**\r\n * Region Discovery Sources\r\n */\r\nconst RegionDiscoverySources = {\r\n FAILED_AUTO_DETECTION: \"1\",\r\n INTERNAL_CACHE: \"2\",\r\n ENVIRONMENT_VARIABLE: \"3\",\r\n IMDS: \"4\",\r\n};\r\n/**\r\n * Region Discovery Outcomes\r\n */\r\nconst RegionDiscoveryOutcomes = {\r\n CONFIGURED_MATCHES_DETECTED: \"1\",\r\n CONFIGURED_NO_AUTO_DETECTION: \"2\",\r\n CONFIGURED_NOT_DETECTED: \"3\",\r\n AUTO_DETECTION_REQUESTED_SUCCESSFUL: \"4\",\r\n AUTO_DETECTION_REQUESTED_FAILED: \"5\",\r\n};\r\n/**\r\n * Specifies the reason for fetching the access token from the identity provider\r\n */\r\nconst CacheOutcome = {\r\n // When a token is found in the cache or the cache is not supposed to be hit when making the request\r\n NOT_APPLICABLE: \"0\",\r\n // When the token request goes to the identity provider because force_refresh was set to true. Also occurs if claims were requested\r\n FORCE_REFRESH_OR_CLAIMS: \"1\",\r\n // When the token request goes to the identity provider because no cached access token exists\r\n NO_CACHED_ACCESS_TOKEN: \"2\",\r\n // When the token request goes to the identity provider because cached access token expired\r\n CACHED_ACCESS_TOKEN_EXPIRED: \"3\",\r\n // When the token request goes to the identity provider because refresh_in was used and the existing token needs to be refreshed\r\n PROACTIVELY_REFRESHED: \"4\",\r\n};\r\nconst JsonWebTokenTypes = {\r\n Jwt: \"JWT\",\r\n Jwk: \"JWK\",\r\n Pop: \"pop\",\r\n};\r\nconst ONE_DAY_IN_MS = 86400000;\r\n// Token renewal offset default in seconds\r\nconst DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\n\nexport { AADAuthorityConstants, APP_METADATA, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme, AuthorityMetadataSource, CLIENT_INFO, CacheAccountType, CacheOutcome, CacheType, ClaimsRequestKeys, CodeChallengeMethodValues, Constants, CredentialType, DEFAULT_TOKEN_RENEWAL_OFFSET_SEC, Errors, GrantType, HeaderNames, HttpStatus, JsonWebTokenTypes, OIDC_DEFAULT_SCOPES, OIDC_SCOPES, ONE_DAY_IN_MS, PasswordGrantConstants, PersistentCacheKeys, PromptValue, RegionDiscoveryOutcomes, RegionDiscoverySources, ResponseCodes, ResponseMode, SERVER_TELEM_CONSTANTS, Separators, ServerResponseType, THE_FAMILY_ID, ThrottlingConstants };\n//# sourceMappingURL=Constants.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * AuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nconst unexpectedError = \"unexpected_error\";\r\nconst postRequestFailed = \"post_request_failed\";\n\nexport { postRequestFailed, unexpectedError };\n//# sourceMappingURL=AuthErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants } from '../utils/Constants.mjs';\nimport { unexpectedError, postRequestFailed } from './AuthErrorCodes.mjs';\nimport * as AuthErrorCodes from './AuthErrorCodes.mjs';\nexport { AuthErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst AuthErrorMessages = {\r\n [unexpectedError]: \"Unexpected error in authentication.\",\r\n [postRequestFailed]: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\",\r\n};\r\n/**\r\n * AuthErrorMessage class containing string constants used by error codes and messages.\r\n * @deprecated Use AuthErrorCodes instead\r\n */\r\nconst AuthErrorMessage = {\r\n unexpectedError: {\r\n code: unexpectedError,\r\n desc: AuthErrorMessages[unexpectedError],\r\n },\r\n postRequestFailed: {\r\n code: postRequestFailed,\r\n desc: AuthErrorMessages[postRequestFailed],\r\n },\r\n};\r\n/**\r\n * General error class thrown by the MSAL.js library.\r\n */\r\nclass AuthError extends Error {\r\n constructor(errorCode, errorMessage, suberror) {\r\n const errorString = errorMessage\r\n ? `${errorCode}: ${errorMessage}`\r\n : errorCode;\r\n super(errorString);\r\n Object.setPrototypeOf(this, AuthError.prototype);\r\n this.errorCode = errorCode || Constants.EMPTY_STRING;\r\n this.errorMessage = errorMessage || Constants.EMPTY_STRING;\r\n this.subError = suberror || Constants.EMPTY_STRING;\r\n this.name = \"AuthError\";\r\n }\r\n setCorrelationId(correlationId) {\r\n this.correlationId = correlationId;\r\n }\r\n}\r\nfunction createAuthError(code, additionalMessage) {\r\n return new AuthError(code, additionalMessage\r\n ? `${AuthErrorMessages[code]} ${additionalMessage}`\r\n : AuthErrorMessages[code]);\r\n}\n\nexport { AuthError, AuthErrorMessage, AuthErrorMessages, createAuthError };\n//# sourceMappingURL=AuthError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst clientInfoDecodingError = \"client_info_decoding_error\";\r\nconst clientInfoEmptyError = \"client_info_empty_error\";\r\nconst tokenParsingError = \"token_parsing_error\";\r\nconst nullOrEmptyToken = \"null_or_empty_token\";\r\nconst endpointResolutionError = \"endpoints_resolution_error\";\r\nconst networkError = \"network_error\";\r\nconst openIdConfigError = \"openid_config_error\";\r\nconst hashNotDeserialized = \"hash_not_deserialized\";\r\nconst invalidState = \"invalid_state\";\r\nconst stateMismatch = \"state_mismatch\";\r\nconst stateNotFound = \"state_not_found\";\r\nconst nonceMismatch = \"nonce_mismatch\";\r\nconst authTimeNotFound = \"auth_time_not_found\";\r\nconst maxAgeTranspired = \"max_age_transpired\";\r\nconst multipleMatchingTokens = \"multiple_matching_tokens\";\r\nconst multipleMatchingAccounts = \"multiple_matching_accounts\";\r\nconst multipleMatchingAppMetadata = \"multiple_matching_appMetadata\";\r\nconst requestCannotBeMade = \"request_cannot_be_made\";\r\nconst cannotRemoveEmptyScope = \"cannot_remove_empty_scope\";\r\nconst cannotAppendScopeSet = \"cannot_append_scopeset\";\r\nconst emptyInputScopeSet = \"empty_input_scopeset\";\r\nconst deviceCodePollingCancelled = \"device_code_polling_cancelled\";\r\nconst deviceCodeExpired = \"device_code_expired\";\r\nconst deviceCodeUnknownError = \"device_code_unknown_error\";\r\nconst noAccountInSilentRequest = \"no_account_in_silent_request\";\r\nconst invalidCacheRecord = \"invalid_cache_record\";\r\nconst invalidCacheEnvironment = \"invalid_cache_environment\";\r\nconst noAccountFound = \"no_account_found\";\r\nconst noCryptoObject = \"no_crypto_object\";\r\nconst unexpectedCredentialType = \"unexpected_credential_type\";\r\nconst invalidAssertion = \"invalid_assertion\";\r\nconst invalidClientCredential = \"invalid_client_credential\";\r\nconst tokenRefreshRequired = \"token_refresh_required\";\r\nconst userTimeoutReached = \"user_timeout_reached\";\r\nconst tokenClaimsCnfRequiredForSignedJwt = \"token_claims_cnf_required_for_signedjwt\";\r\nconst authorizationCodeMissingFromServerResponse = \"authorization_code_missing_from_server_response\";\r\nconst bindingKeyNotRemoved = \"binding_key_not_removed\";\r\nconst endSessionEndpointNotSupported = \"end_session_endpoint_not_supported\";\r\nconst keyIdMissing = \"key_id_missing\";\r\nconst noNetworkConnectivity = \"no_network_connectivity\";\r\nconst userCanceled = \"user_canceled\";\r\nconst missingTenantIdError = \"missing_tenant_id_error\";\r\nconst methodNotImplemented = \"method_not_implemented\";\r\nconst nestedAppAuthBridgeDisabled = \"nested_app_auth_bridge_disabled\";\n\nexport { authTimeNotFound, authorizationCodeMissingFromServerResponse, bindingKeyNotRemoved, cannotAppendScopeSet, cannotRemoveEmptyScope, clientInfoDecodingError, clientInfoEmptyError, deviceCodeExpired, deviceCodePollingCancelled, deviceCodeUnknownError, emptyInputScopeSet, endSessionEndpointNotSupported, endpointResolutionError, hashNotDeserialized, invalidAssertion, invalidCacheEnvironment, invalidCacheRecord, invalidClientCredential, invalidState, keyIdMissing, maxAgeTranspired, methodNotImplemented, missingTenantIdError, multipleMatchingAccounts, multipleMatchingAppMetadata, multipleMatchingTokens, nestedAppAuthBridgeDisabled, networkError, noAccountFound, noAccountInSilentRequest, noCryptoObject, noNetworkConnectivity, nonceMismatch, nullOrEmptyToken, openIdConfigError, requestCannotBeMade, stateMismatch, stateNotFound, tokenClaimsCnfRequiredForSignedJwt, tokenParsingError, tokenRefreshRequired, unexpectedCredentialType, userCanceled, userTimeoutReached };\n//# sourceMappingURL=ClientAuthErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthError } from './AuthError.mjs';\nimport { clientInfoDecodingError, clientInfoEmptyError, tokenParsingError, nullOrEmptyToken, endpointResolutionError, networkError, openIdConfigError, hashNotDeserialized, invalidState, stateMismatch, stateNotFound, nonceMismatch, authTimeNotFound, maxAgeTranspired, multipleMatchingTokens, multipleMatchingAccounts, multipleMatchingAppMetadata, requestCannotBeMade, cannotRemoveEmptyScope, cannotAppendScopeSet, emptyInputScopeSet, deviceCodePollingCancelled, deviceCodeExpired, deviceCodeUnknownError, noAccountInSilentRequest, invalidCacheRecord, invalidCacheEnvironment, noAccountFound, noCryptoObject, unexpectedCredentialType, invalidAssertion, invalidClientCredential, tokenRefreshRequired, userTimeoutReached, tokenClaimsCnfRequiredForSignedJwt, authorizationCodeMissingFromServerResponse, bindingKeyNotRemoved, endSessionEndpointNotSupported, keyIdMissing, noNetworkConnectivity, userCanceled, missingTenantIdError, nestedAppAuthBridgeDisabled, methodNotImplemented } from './ClientAuthErrorCodes.mjs';\nimport * as ClientAuthErrorCodes from './ClientAuthErrorCodes.mjs';\nexport { ClientAuthErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nconst ClientAuthErrorMessages = {\r\n [clientInfoDecodingError]: \"The client info could not be parsed/decoded correctly\",\r\n [clientInfoEmptyError]: \"The client info was empty\",\r\n [tokenParsingError]: \"Token cannot be parsed\",\r\n [nullOrEmptyToken]: \"The token is null or empty\",\r\n [endpointResolutionError]: \"Endpoints cannot be resolved\",\r\n [networkError]: \"Network request failed\",\r\n [openIdConfigError]: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\",\r\n [hashNotDeserialized]: \"The hash parameters could not be deserialized\",\r\n [invalidState]: \"State was not the expected format\",\r\n [stateMismatch]: \"State mismatch error\",\r\n [stateNotFound]: \"State not found\",\r\n [nonceMismatch]: \"Nonce mismatch error\",\r\n [authTimeNotFound]: \"Max Age was requested and the ID token is missing the auth_time variable.\" +\r\n \" auth_time is an optional claim and is not enabled by default - it must be enabled.\" +\r\n \" See https://aka.ms/msaljs/optional-claims for more information.\",\r\n [maxAgeTranspired]: \"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.\",\r\n [multipleMatchingTokens]: \"The cache contains multiple tokens satisfying the requirements. \" +\r\n \"Call AcquireToken again providing more requirements such as authority or account.\",\r\n [multipleMatchingAccounts]: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\",\r\n [multipleMatchingAppMetadata]: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\",\r\n [requestCannotBeMade]: \"Token request cannot be made without authorization code or refresh token.\",\r\n [cannotRemoveEmptyScope]: \"Cannot remove null or empty scope from ScopeSet\",\r\n [cannotAppendScopeSet]: \"Cannot append ScopeSet\",\r\n [emptyInputScopeSet]: \"Empty input ScopeSet cannot be processed\",\r\n [deviceCodePollingCancelled]: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\",\r\n [deviceCodeExpired]: \"Device code is expired.\",\r\n [deviceCodeUnknownError]: \"Device code stopped polling for unknown reasons.\",\r\n [noAccountInSilentRequest]: \"Please pass an account object, silent flow is not supported without account information\",\r\n [invalidCacheRecord]: \"Cache record object was null or undefined.\",\r\n [invalidCacheEnvironment]: \"Invalid environment when attempting to create cache entry\",\r\n [noAccountFound]: \"No account found in cache for given key.\",\r\n [noCryptoObject]: \"No crypto object detected.\",\r\n [unexpectedCredentialType]: \"Unexpected credential type.\",\r\n [invalidAssertion]: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\",\r\n [invalidClientCredential]: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\",\r\n [tokenRefreshRequired]: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\",\r\n [userTimeoutReached]: \"User defined timeout for device code polling reached\",\r\n [tokenClaimsCnfRequiredForSignedJwt]: \"Cannot generate a POP jwt if the token_claims are not populated\",\r\n [authorizationCodeMissingFromServerResponse]: \"Server response does not contain an authorization code to proceed\",\r\n [bindingKeyNotRemoved]: \"Could not remove the credential's binding key from storage.\",\r\n [endSessionEndpointNotSupported]: \"The provided authority does not support logout\",\r\n [keyIdMissing]: \"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.\",\r\n [noNetworkConnectivity]: \"No network connectivity. Check your internet connection.\",\r\n [userCanceled]: \"User cancelled the flow.\",\r\n [missingTenantIdError]: \"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.\",\r\n [methodNotImplemented]: \"This method has not been implemented\",\r\n [nestedAppAuthBridgeDisabled]: \"The nested app auth bridge is disabled\",\r\n};\r\n/**\r\n * String constants used by error codes and messages.\r\n * @deprecated Use ClientAuthErrorCodes instead\r\n */\r\nconst ClientAuthErrorMessage = {\r\n clientInfoDecodingError: {\r\n code: clientInfoDecodingError,\r\n desc: ClientAuthErrorMessages[clientInfoDecodingError],\r\n },\r\n clientInfoEmptyError: {\r\n code: clientInfoEmptyError,\r\n desc: ClientAuthErrorMessages[clientInfoEmptyError],\r\n },\r\n tokenParsingError: {\r\n code: tokenParsingError,\r\n desc: ClientAuthErrorMessages[tokenParsingError],\r\n },\r\n nullOrEmptyToken: {\r\n code: nullOrEmptyToken,\r\n desc: ClientAuthErrorMessages[nullOrEmptyToken],\r\n },\r\n endpointResolutionError: {\r\n code: endpointResolutionError,\r\n desc: ClientAuthErrorMessages[endpointResolutionError],\r\n },\r\n networkError: {\r\n code: networkError,\r\n desc: ClientAuthErrorMessages[networkError],\r\n },\r\n unableToGetOpenidConfigError: {\r\n code: openIdConfigError,\r\n desc: ClientAuthErrorMessages[openIdConfigError],\r\n },\r\n hashNotDeserialized: {\r\n code: hashNotDeserialized,\r\n desc: ClientAuthErrorMessages[hashNotDeserialized],\r\n },\r\n invalidStateError: {\r\n code: invalidState,\r\n desc: ClientAuthErrorMessages[invalidState],\r\n },\r\n stateMismatchError: {\r\n code: stateMismatch,\r\n desc: ClientAuthErrorMessages[stateMismatch],\r\n },\r\n stateNotFoundError: {\r\n code: stateNotFound,\r\n desc: ClientAuthErrorMessages[stateNotFound],\r\n },\r\n nonceMismatchError: {\r\n code: nonceMismatch,\r\n desc: ClientAuthErrorMessages[nonceMismatch],\r\n },\r\n authTimeNotFoundError: {\r\n code: authTimeNotFound,\r\n desc: ClientAuthErrorMessages[authTimeNotFound],\r\n },\r\n maxAgeTranspired: {\r\n code: maxAgeTranspired,\r\n desc: ClientAuthErrorMessages[maxAgeTranspired],\r\n },\r\n multipleMatchingTokens: {\r\n code: multipleMatchingTokens,\r\n desc: ClientAuthErrorMessages[multipleMatchingTokens],\r\n },\r\n multipleMatchingAccounts: {\r\n code: multipleMatchingAccounts,\r\n desc: ClientAuthErrorMessages[multipleMatchingAccounts],\r\n },\r\n multipleMatchingAppMetadata: {\r\n code: multipleMatchingAppMetadata,\r\n desc: ClientAuthErrorMessages[multipleMatchingAppMetadata],\r\n },\r\n tokenRequestCannotBeMade: {\r\n code: requestCannotBeMade,\r\n desc: ClientAuthErrorMessages[requestCannotBeMade],\r\n },\r\n removeEmptyScopeError: {\r\n code: cannotRemoveEmptyScope,\r\n desc: ClientAuthErrorMessages[cannotRemoveEmptyScope],\r\n },\r\n appendScopeSetError: {\r\n code: cannotAppendScopeSet,\r\n desc: ClientAuthErrorMessages[cannotAppendScopeSet],\r\n },\r\n emptyInputScopeSetError: {\r\n code: emptyInputScopeSet,\r\n desc: ClientAuthErrorMessages[emptyInputScopeSet],\r\n },\r\n DeviceCodePollingCancelled: {\r\n code: deviceCodePollingCancelled,\r\n desc: ClientAuthErrorMessages[deviceCodePollingCancelled],\r\n },\r\n DeviceCodeExpired: {\r\n code: deviceCodeExpired,\r\n desc: ClientAuthErrorMessages[deviceCodeExpired],\r\n },\r\n DeviceCodeUnknownError: {\r\n code: deviceCodeUnknownError,\r\n desc: ClientAuthErrorMessages[deviceCodeUnknownError],\r\n },\r\n NoAccountInSilentRequest: {\r\n code: noAccountInSilentRequest,\r\n desc: ClientAuthErrorMessages[noAccountInSilentRequest],\r\n },\r\n invalidCacheRecord: {\r\n code: invalidCacheRecord,\r\n desc: ClientAuthErrorMessages[invalidCacheRecord],\r\n },\r\n invalidCacheEnvironment: {\r\n code: invalidCacheEnvironment,\r\n desc: ClientAuthErrorMessages[invalidCacheEnvironment],\r\n },\r\n noAccountFound: {\r\n code: noAccountFound,\r\n desc: ClientAuthErrorMessages[noAccountFound],\r\n },\r\n noCryptoObj: {\r\n code: noCryptoObject,\r\n desc: ClientAuthErrorMessages[noCryptoObject],\r\n },\r\n unexpectedCredentialType: {\r\n code: unexpectedCredentialType,\r\n desc: ClientAuthErrorMessages[unexpectedCredentialType],\r\n },\r\n invalidAssertion: {\r\n code: invalidAssertion,\r\n desc: ClientAuthErrorMessages[invalidAssertion],\r\n },\r\n invalidClientCredential: {\r\n code: invalidClientCredential,\r\n desc: ClientAuthErrorMessages[invalidClientCredential],\r\n },\r\n tokenRefreshRequired: {\r\n code: tokenRefreshRequired,\r\n desc: ClientAuthErrorMessages[tokenRefreshRequired],\r\n },\r\n userTimeoutReached: {\r\n code: userTimeoutReached,\r\n desc: ClientAuthErrorMessages[userTimeoutReached],\r\n },\r\n tokenClaimsRequired: {\r\n code: tokenClaimsCnfRequiredForSignedJwt,\r\n desc: ClientAuthErrorMessages[tokenClaimsCnfRequiredForSignedJwt],\r\n },\r\n noAuthorizationCodeFromServer: {\r\n code: authorizationCodeMissingFromServerResponse,\r\n desc: ClientAuthErrorMessages[authorizationCodeMissingFromServerResponse],\r\n },\r\n bindingKeyNotRemovedError: {\r\n code: bindingKeyNotRemoved,\r\n desc: ClientAuthErrorMessages[bindingKeyNotRemoved],\r\n },\r\n logoutNotSupported: {\r\n code: endSessionEndpointNotSupported,\r\n desc: ClientAuthErrorMessages[endSessionEndpointNotSupported],\r\n },\r\n keyIdMissing: {\r\n code: keyIdMissing,\r\n desc: ClientAuthErrorMessages[keyIdMissing],\r\n },\r\n noNetworkConnectivity: {\r\n code: noNetworkConnectivity,\r\n desc: ClientAuthErrorMessages[noNetworkConnectivity],\r\n },\r\n userCanceledError: {\r\n code: userCanceled,\r\n desc: ClientAuthErrorMessages[userCanceled],\r\n },\r\n missingTenantIdError: {\r\n code: missingTenantIdError,\r\n desc: ClientAuthErrorMessages[missingTenantIdError],\r\n },\r\n nestedAppAuthBridgeDisabled: {\r\n code: nestedAppAuthBridgeDisabled,\r\n desc: ClientAuthErrorMessages[nestedAppAuthBridgeDisabled],\r\n },\r\n};\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nclass ClientAuthError extends AuthError {\r\n constructor(errorCode, additionalMessage) {\r\n super(errorCode, additionalMessage\r\n ? `${ClientAuthErrorMessages[errorCode]}: ${additionalMessage}`\r\n : ClientAuthErrorMessages[errorCode]);\r\n this.name = \"ClientAuthError\";\r\n Object.setPrototypeOf(this, ClientAuthError.prototype);\r\n }\r\n}\r\nfunction createClientAuthError(errorCode, additionalMessage) {\r\n return new ClientAuthError(errorCode, additionalMessage);\r\n}\n\nexport { ClientAuthError, ClientAuthErrorMessage, ClientAuthErrorMessages, createClientAuthError };\n//# sourceMappingURL=ClientAuthError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst DEFAULT_CRYPTO_IMPLEMENTATION = {\r\n createNewGuid: () => {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n base64Decode: () => {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n base64Encode: () => {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n base64UrlEncode: () => {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n encodeKid: () => {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async getPublicKeyThumbprint() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async removeTokenBindingKey() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async clearKeystore() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async signJwt() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async hashString() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n};\n\nexport { DEFAULT_CRYPTO_IMPLEMENTATION };\n//# sourceMappingURL=ICrypto.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants } from '../utils/Constants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Log message level.\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"Error\"] = 0] = \"Error\";\r\n LogLevel[LogLevel[\"Warning\"] = 1] = \"Warning\";\r\n LogLevel[LogLevel[\"Info\"] = 2] = \"Info\";\r\n LogLevel[LogLevel[\"Verbose\"] = 3] = \"Verbose\";\r\n LogLevel[LogLevel[\"Trace\"] = 4] = \"Trace\";\r\n})(LogLevel || (LogLevel = {}));\r\n/**\r\n * Class which facilitates logging of messages to a specific place.\r\n */\r\nclass Logger {\r\n constructor(loggerOptions, packageName, packageVersion) {\r\n // Current log level, defaults to info.\r\n this.level = LogLevel.Info;\r\n const defaultLoggerCallback = () => {\r\n return;\r\n };\r\n const setLoggerOptions = loggerOptions || Logger.createDefaultLoggerOptions();\r\n this.localCallback =\r\n setLoggerOptions.loggerCallback || defaultLoggerCallback;\r\n this.piiLoggingEnabled = setLoggerOptions.piiLoggingEnabled || false;\r\n this.level =\r\n typeof setLoggerOptions.logLevel === \"number\"\r\n ? setLoggerOptions.logLevel\r\n : LogLevel.Info;\r\n this.correlationId =\r\n setLoggerOptions.correlationId || Constants.EMPTY_STRING;\r\n this.packageName = packageName || Constants.EMPTY_STRING;\r\n this.packageVersion = packageVersion || Constants.EMPTY_STRING;\r\n }\r\n static createDefaultLoggerOptions() {\r\n return {\r\n loggerCallback: () => {\r\n // allow users to not set loggerCallback\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n };\r\n }\r\n /**\r\n * Create new Logger with existing configurations.\r\n */\r\n clone(packageName, packageVersion, correlationId) {\r\n return new Logger({\r\n loggerCallback: this.localCallback,\r\n piiLoggingEnabled: this.piiLoggingEnabled,\r\n logLevel: this.level,\r\n correlationId: correlationId || this.correlationId,\r\n }, packageName, packageVersion);\r\n }\r\n /**\r\n * Log message with required options.\r\n */\r\n logMessage(logMessage, options) {\r\n if (options.logLevel > this.level ||\r\n (!this.piiLoggingEnabled && options.containsPii)) {\r\n return;\r\n }\r\n const timestamp = new Date().toUTCString();\r\n // Add correlationId to logs if set, correlationId provided on log messages take precedence\r\n const logHeader = `[${timestamp}] : [${options.correlationId || this.correlationId || \"\"}]`;\r\n const log = `${logHeader} : ${this.packageName}@${this.packageVersion} : ${LogLevel[options.logLevel]} - ${logMessage}`;\r\n // debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? \"-Pii\": Constants.EMPTY_STRING}${options.context ? `:${options.context}` : Constants.EMPTY_STRING}`)(logMessage);\r\n this.executeCallback(options.logLevel, log, options.containsPii || false);\r\n }\r\n /**\r\n * Execute callback with message.\r\n */\r\n executeCallback(level, message, containsPii) {\r\n if (this.localCallback) {\r\n this.localCallback(level, message, containsPii);\r\n }\r\n }\r\n /**\r\n * Logs error messages.\r\n */\r\n error(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Error,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs error messages with PII.\r\n */\r\n errorPii(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Error,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs warning messages.\r\n */\r\n warning(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Warning,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs warning messages with PII.\r\n */\r\n warningPii(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Warning,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs info messages.\r\n */\r\n info(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Info,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs info messages with PII.\r\n */\r\n infoPii(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Info,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs verbose messages.\r\n */\r\n verbose(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Verbose,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs verbose messages with PII.\r\n */\r\n verbosePii(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Verbose,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs trace messages.\r\n */\r\n trace(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Trace,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Logs trace messages with PII.\r\n */\r\n tracePii(message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Trace,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING,\r\n });\r\n }\r\n /**\r\n * Returns whether PII Logging is enabled or not.\r\n */\r\n isPiiLoggingEnabled() {\r\n return this.piiLoggingEnabled || false;\r\n }\r\n}\n\nexport { LogLevel, Logger };\n//# sourceMappingURL=Logger.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/* eslint-disable header/header */\r\nconst name = \"@azure/msal-common\";\r\nconst version = \"15.3.0\";\n\nexport { name, version };\n//# sourceMappingURL=packageMetadata.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst AzureCloudInstance = {\r\n // AzureCloudInstance is not specified.\r\n None: \"none\",\r\n // Microsoft Azure public cloud\r\n AzurePublic: \"https://login.microsoftonline.com\",\r\n // Microsoft PPE\r\n AzurePpe: \"https://login.windows-ppe.net\",\r\n // Microsoft Chinese national/regional cloud\r\n AzureChina: \"https://login.chinacloudapi.cn\",\r\n // Microsoft German national/regional cloud (\"Black Forest\")\r\n AzureGermany: \"https://login.microsoftonline.de\",\r\n // US Government cloud\r\n AzureUsGovernment: \"https://login.microsoftonline.us\",\r\n};\n\nexport { AzureCloudInstance };\n//# sourceMappingURL=AuthorityOptions.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { tokenParsingError, nullOrEmptyToken, maxAgeTranspired } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Extract token by decoding the rawToken\r\n *\r\n * @param encodedToken\r\n */\r\nfunction extractTokenClaims(encodedToken, base64Decode) {\r\n const jswPayload = getJWSPayload(encodedToken);\r\n // token will be decoded to get the username\r\n try {\r\n // base64Decode() should throw an error if there is an issue\r\n const base64Decoded = base64Decode(jswPayload);\r\n return JSON.parse(base64Decoded);\r\n }\r\n catch (err) {\r\n throw createClientAuthError(tokenParsingError);\r\n }\r\n}\r\n/**\r\n * decode a JWT\r\n *\r\n * @param authToken\r\n */\r\nfunction getJWSPayload(authToken) {\r\n if (!authToken) {\r\n throw createClientAuthError(nullOrEmptyToken);\r\n }\r\n const tokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n const matches = tokenPartsRegex.exec(authToken);\r\n if (!matches || matches.length < 4) {\r\n throw createClientAuthError(tokenParsingError);\r\n }\r\n /**\r\n * const crackedToken = {\r\n * header: matches[1],\r\n * JWSPayload: matches[2],\r\n * JWSSig: matches[3],\r\n * };\r\n */\r\n return matches[2];\r\n}\r\n/**\r\n * Determine if the token's max_age has transpired\r\n */\r\nfunction checkMaxAge(authTime, maxAge) {\r\n /*\r\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\r\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\r\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\r\n */\r\n const fiveMinuteSkew = 300000; // five minutes in milliseconds\r\n if (maxAge === 0 || Date.now() - fiveMinuteSkew > authTime + maxAge) {\r\n throw createClientAuthError(maxAgeTranspired);\r\n }\r\n}\n\nexport { checkMaxAge, extractTokenClaims, getJWSPayload };\n//# sourceMappingURL=AuthToken.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Utility functions for managing date and time operations.\r\n */\r\n/**\r\n * return the current time in Unix time (seconds).\r\n */\r\nfunction nowSeconds() {\r\n // Date.getTime() returns in milliseconds.\r\n return Math.round(new Date().getTime() / 1000.0);\r\n}\r\n/**\r\n * Converts JS Date object to seconds\r\n * @param date Date\r\n */\r\nfunction toSecondsFromDate(date) {\r\n // Convert date to seconds\r\n return date.getTime() / 1000;\r\n}\r\n/**\r\n * Convert seconds to JS Date object. Seconds can be in a number or string format or undefined (will still return a date).\r\n * @param seconds\r\n */\r\nfunction toDateFromSeconds(seconds) {\r\n if (seconds) {\r\n return new Date(Number(seconds) * 1000);\r\n }\r\n return new Date();\r\n}\r\n/**\r\n * check if a token is expired based on given UTC time in seconds.\r\n * @param expiresOn\r\n */\r\nfunction isTokenExpired(expiresOn, offset) {\r\n // check for access token expiry\r\n const expirationSec = Number(expiresOn) || 0;\r\n const offsetCurrentTimeSec = nowSeconds() + offset;\r\n // If current time + offset is greater than token expiration time, then token is expired.\r\n return offsetCurrentTimeSec > expirationSec;\r\n}\r\n/**\r\n * If the current time is earlier than the time that a token was cached at, we must discard the token\r\n * i.e. The system clock was turned back after acquiring the cached token\r\n * @param cachedAt\r\n * @param offset\r\n */\r\nfunction wasClockTurnedBack(cachedAt) {\r\n const cachedAtSec = Number(cachedAt);\r\n return cachedAtSec > nowSeconds();\r\n}\r\n/**\r\n * Waits for t number of milliseconds\r\n * @param t number\r\n * @param value T\r\n */\r\nfunction delay(t, value) {\r\n return new Promise((resolve) => setTimeout(() => resolve(value), t));\r\n}\n\nexport { delay, isTokenExpired, nowSeconds, toDateFromSeconds, toSecondsFromDate, wasClockTurnedBack };\n//# sourceMappingURL=TimeUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { extractTokenClaims } from '../../account/AuthToken.mjs';\nimport { createClientAuthError } from '../../error/ClientAuthError.mjs';\nimport { Separators, CredentialType, AuthenticationScheme, SERVER_TELEM_CONSTANTS, ThrottlingConstants, APP_METADATA, AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.mjs';\nimport { nowSeconds } from '../../utils/TimeUtils.mjs';\nimport { tokenClaimsCnfRequiredForSignedJwt } from '../../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Cache Key: -------\r\n * IdToken Example: uid.utid-login.microsoftonline.com-idtoken-app_client_id-contoso.com\r\n * AccessToken Example: uid.utid-login.microsoftonline.com-accesstoken-app_client_id-contoso.com-scope1 scope2--pop\r\n * RefreshToken Example: uid.utid-login.microsoftonline.com-refreshtoken-1-contoso.com\r\n * @param credentialEntity\r\n * @returns\r\n */\r\nfunction generateCredentialKey(credentialEntity) {\r\n const credentialKey = [\r\n generateAccountId(credentialEntity),\r\n generateCredentialId(credentialEntity),\r\n generateTarget(credentialEntity),\r\n generateClaimsHash(credentialEntity),\r\n generateScheme(credentialEntity),\r\n ];\r\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n}\r\n/**\r\n * Create IdTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\nfunction createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {\r\n const idTokenEntity = {\r\n credentialType: CredentialType.ID_TOKEN,\r\n homeAccountId: homeAccountId,\r\n environment: environment,\r\n clientId: clientId,\r\n secret: idToken,\r\n realm: tenantId,\r\n };\r\n return idTokenEntity;\r\n}\r\n/**\r\n * Create AccessTokenEntity\r\n * @param homeAccountId\r\n * @param environment\r\n * @param accessToken\r\n * @param clientId\r\n * @param tenantId\r\n * @param scopes\r\n * @param expiresOn\r\n * @param extExpiresOn\r\n */\r\nfunction createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, base64Decode, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {\r\n const atEntity = {\r\n homeAccountId: homeAccountId,\r\n credentialType: CredentialType.ACCESS_TOKEN,\r\n secret: accessToken,\r\n cachedAt: nowSeconds().toString(),\r\n expiresOn: expiresOn.toString(),\r\n extendedExpiresOn: extExpiresOn.toString(),\r\n environment: environment,\r\n clientId: clientId,\r\n realm: tenantId,\r\n target: scopes,\r\n tokenType: tokenType || AuthenticationScheme.BEARER,\r\n };\r\n if (userAssertionHash) {\r\n atEntity.userAssertionHash = userAssertionHash;\r\n }\r\n if (refreshOn) {\r\n atEntity.refreshOn = refreshOn.toString();\r\n }\r\n if (requestedClaims) {\r\n atEntity.requestedClaims = requestedClaims;\r\n atEntity.requestedClaimsHash = requestedClaimsHash;\r\n }\r\n /*\r\n * Create Access Token With Auth Scheme instead of regular access token\r\n * Cast to lower to handle \"bearer\" from ADFS\r\n */\r\n if (atEntity.tokenType?.toLowerCase() !==\r\n AuthenticationScheme.BEARER.toLowerCase()) {\r\n atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\r\n switch (atEntity.tokenType) {\r\n case AuthenticationScheme.POP:\r\n // Make sure keyId is present and add it to credential\r\n const tokenClaims = extractTokenClaims(accessToken, base64Decode);\r\n if (!tokenClaims?.cnf?.kid) {\r\n throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);\r\n }\r\n atEntity.keyId = tokenClaims.cnf.kid;\r\n break;\r\n case AuthenticationScheme.SSH:\r\n atEntity.keyId = keyId;\r\n }\r\n }\r\n return atEntity;\r\n}\r\n/**\r\n * Create RefreshTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\nfunction createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash, expiresOn) {\r\n const rtEntity = {\r\n credentialType: CredentialType.REFRESH_TOKEN,\r\n homeAccountId: homeAccountId,\r\n environment: environment,\r\n clientId: clientId,\r\n secret: refreshToken,\r\n };\r\n if (userAssertionHash) {\r\n rtEntity.userAssertionHash = userAssertionHash;\r\n }\r\n if (familyId) {\r\n rtEntity.familyId = familyId;\r\n }\r\n if (expiresOn) {\r\n rtEntity.expiresOn = expiresOn.toString();\r\n }\r\n return rtEntity;\r\n}\r\nfunction isCredentialEntity(entity) {\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\"));\r\n}\r\n/**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\nfunction isAccessTokenEntity(entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (isCredentialEntity(entity) &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"target\") &&\r\n (entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN ||\r\n entity[\"credentialType\"] ===\r\n CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));\r\n}\r\n/**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\nfunction isIdTokenEntity(entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (isCredentialEntity(entity) &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity[\"credentialType\"] === CredentialType.ID_TOKEN);\r\n}\r\n/**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\nfunction isRefreshTokenEntity(entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (isCredentialEntity(entity) &&\r\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN);\r\n}\r\n/**\r\n * Generate Account Id key component as per the schema: -\r\n */\r\nfunction generateAccountId(credentialEntity) {\r\n const accountId = [\r\n credentialEntity.homeAccountId,\r\n credentialEntity.environment,\r\n ];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n}\r\n/**\r\n * Generate Credential Id key component as per the schema: --\r\n */\r\nfunction generateCredentialId(credentialEntity) {\r\n const clientOrFamilyId = credentialEntity.credentialType === CredentialType.REFRESH_TOKEN\r\n ? credentialEntity.familyId || credentialEntity.clientId\r\n : credentialEntity.clientId;\r\n const credentialId = [\r\n credentialEntity.credentialType,\r\n clientOrFamilyId,\r\n credentialEntity.realm || \"\",\r\n ];\r\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n}\r\n/**\r\n * Generate target key component as per schema: \r\n */\r\nfunction generateTarget(credentialEntity) {\r\n return (credentialEntity.target || \"\").toLowerCase();\r\n}\r\n/**\r\n * Generate requested claims key component as per schema: \r\n */\r\nfunction generateClaimsHash(credentialEntity) {\r\n return (credentialEntity.requestedClaimsHash || \"\").toLowerCase();\r\n}\r\n/**\r\n * Generate scheme key componenet as per schema: \r\n */\r\nfunction generateScheme(credentialEntity) {\r\n /*\r\n * PoP Tokens and SSH certs include scheme in cache key\r\n * Cast to lowercase to handle \"bearer\" from ADFS\r\n */\r\n return credentialEntity.tokenType &&\r\n credentialEntity.tokenType.toLowerCase() !==\r\n AuthenticationScheme.BEARER.toLowerCase()\r\n ? credentialEntity.tokenType.toLowerCase()\r\n : \"\";\r\n}\r\n/**\r\n * validates if a given cache entry is \"Telemetry\", parses \r\n * @param key\r\n * @param entity\r\n */\r\nfunction isServerTelemetryEntity(key, entity) {\r\n const validateKey = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\r\n let validateEntity = true;\r\n if (entity) {\r\n validateEntity =\r\n entity.hasOwnProperty(\"failedRequests\") &&\r\n entity.hasOwnProperty(\"errors\") &&\r\n entity.hasOwnProperty(\"cacheHits\");\r\n }\r\n return validateKey && validateEntity;\r\n}\r\n/**\r\n * validates if a given cache entry is \"Throttling\", parses \r\n * @param key\r\n * @param entity\r\n */\r\nfunction isThrottlingEntity(key, entity) {\r\n let validateKey = false;\r\n if (key) {\r\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\r\n }\r\n let validateEntity = true;\r\n if (entity) {\r\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\r\n }\r\n return validateKey && validateEntity;\r\n}\r\n/**\r\n * Generate AppMetadata Cache Key as per the schema: appmetadata--\r\n */\r\nfunction generateAppMetadataKey({ environment, clientId, }) {\r\n const appMetaDataKeyArray = [\r\n APP_METADATA,\r\n environment,\r\n clientId,\r\n ];\r\n return appMetaDataKeyArray\r\n .join(Separators.CACHE_KEY_SEPARATOR)\r\n .toLowerCase();\r\n}\r\n/*\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\nfunction isAppMetadataEntity(key, entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (key.indexOf(APP_METADATA) === 0 &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"environment\"));\r\n}\r\n/**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\nfunction isAuthorityMetadataEntity(key, entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\r\n entity.hasOwnProperty(\"aliases\") &&\r\n entity.hasOwnProperty(\"preferred_cache\") &&\r\n entity.hasOwnProperty(\"preferred_network\") &&\r\n entity.hasOwnProperty(\"canonical_authority\") &&\r\n entity.hasOwnProperty(\"authorization_endpoint\") &&\r\n entity.hasOwnProperty(\"token_endpoint\") &&\r\n entity.hasOwnProperty(\"issuer\") &&\r\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\r\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\r\n entity.hasOwnProperty(\"expiresAt\") &&\r\n entity.hasOwnProperty(\"jwks_uri\"));\r\n}\r\n/**\r\n * Reset the exiresAt value\r\n */\r\nfunction generateAuthorityMetadataExpiresAt() {\r\n return (nowSeconds() +\r\n AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS);\r\n}\r\nfunction updateAuthorityEndpointMetadata(authorityMetadata, updatedValues, fromNetwork) {\r\n authorityMetadata.authorization_endpoint =\r\n updatedValues.authorization_endpoint;\r\n authorityMetadata.token_endpoint = updatedValues.token_endpoint;\r\n authorityMetadata.end_session_endpoint = updatedValues.end_session_endpoint;\r\n authorityMetadata.issuer = updatedValues.issuer;\r\n authorityMetadata.endpointsFromNetwork = fromNetwork;\r\n authorityMetadata.jwks_uri = updatedValues.jwks_uri;\r\n}\r\nfunction updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetwork) {\r\n authorityMetadata.aliases = updatedValues.aliases;\r\n authorityMetadata.preferred_cache = updatedValues.preferred_cache;\r\n authorityMetadata.preferred_network = updatedValues.preferred_network;\r\n authorityMetadata.aliasesFromNetwork = fromNetwork;\r\n}\r\n/**\r\n * Returns whether or not the data needs to be refreshed\r\n */\r\nfunction isAuthorityMetadataExpired(metadata) {\r\n return metadata.expiresAt <= nowSeconds();\r\n}\n\nexport { createAccessTokenEntity, createIdTokenEntity, createRefreshTokenEntity, generateAppMetadataKey, generateAuthorityMetadataExpiresAt, generateCredentialKey, isAccessTokenEntity, isAppMetadataEntity, isAuthorityMetadataEntity, isAuthorityMetadataExpired, isCredentialEntity, isIdTokenEntity, isRefreshTokenEntity, isServerTelemetryEntity, isThrottlingEntity, updateAuthorityEndpointMetadata, updateCloudDiscoveryMetadata };\n//# sourceMappingURL=CacheHelpers.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst redirectUriEmpty = \"redirect_uri_empty\";\r\nconst claimsRequestParsingError = \"claims_request_parsing_error\";\r\nconst authorityUriInsecure = \"authority_uri_insecure\";\r\nconst urlParseError = \"url_parse_error\";\r\nconst urlEmptyError = \"empty_url_error\";\r\nconst emptyInputScopesError = \"empty_input_scopes_error\";\r\nconst invalidPromptValue = \"invalid_prompt_value\";\r\nconst invalidClaims = \"invalid_claims\";\r\nconst tokenRequestEmpty = \"token_request_empty\";\r\nconst logoutRequestEmpty = \"logout_request_empty\";\r\nconst invalidCodeChallengeMethod = \"invalid_code_challenge_method\";\r\nconst pkceParamsMissing = \"pkce_params_missing\";\r\nconst invalidCloudDiscoveryMetadata = \"invalid_cloud_discovery_metadata\";\r\nconst invalidAuthorityMetadata = \"invalid_authority_metadata\";\r\nconst untrustedAuthority = \"untrusted_authority\";\r\nconst missingSshJwk = \"missing_ssh_jwk\";\r\nconst missingSshKid = \"missing_ssh_kid\";\r\nconst missingNonceAuthenticationHeader = \"missing_nonce_authentication_header\";\r\nconst invalidAuthenticationHeader = \"invalid_authentication_header\";\r\nconst cannotSetOIDCOptions = \"cannot_set_OIDCOptions\";\r\nconst cannotAllowPlatformBroker = \"cannot_allow_platform_broker\";\r\nconst authorityMismatch = \"authority_mismatch\";\n\nexport { authorityMismatch, authorityUriInsecure, cannotAllowPlatformBroker, cannotSetOIDCOptions, claimsRequestParsingError, emptyInputScopesError, invalidAuthenticationHeader, invalidAuthorityMetadata, invalidClaims, invalidCloudDiscoveryMetadata, invalidCodeChallengeMethod, invalidPromptValue, logoutRequestEmpty, missingNonceAuthenticationHeader, missingSshJwk, missingSshKid, pkceParamsMissing, redirectUriEmpty, tokenRequestEmpty, untrustedAuthority, urlEmptyError, urlParseError };\n//# sourceMappingURL=ClientConfigurationErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthError } from './AuthError.mjs';\nimport { redirectUriEmpty, claimsRequestParsingError, authorityUriInsecure, urlParseError, urlEmptyError, emptyInputScopesError, invalidPromptValue, invalidClaims, tokenRequestEmpty, logoutRequestEmpty, invalidCodeChallengeMethod, pkceParamsMissing, invalidCloudDiscoveryMetadata, invalidAuthorityMetadata, untrustedAuthority, missingSshJwk, missingSshKid, missingNonceAuthenticationHeader, invalidAuthenticationHeader, cannotSetOIDCOptions, cannotAllowPlatformBroker, authorityMismatch } from './ClientConfigurationErrorCodes.mjs';\nimport * as ClientConfigurationErrorCodes from './ClientConfigurationErrorCodes.mjs';\nexport { ClientConfigurationErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst ClientConfigurationErrorMessages = {\r\n [redirectUriEmpty]: \"A redirect URI is required for all calls, and none has been set.\",\r\n [claimsRequestParsingError]: \"Could not parse the given claims request object.\",\r\n [authorityUriInsecure]: \"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options\",\r\n [urlParseError]: \"URL could not be parsed into appropriate segments.\",\r\n [urlEmptyError]: \"URL was empty or null.\",\r\n [emptyInputScopesError]: \"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.\",\r\n [invalidPromptValue]: \"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest\",\r\n [invalidClaims]: \"Given claims parameter must be a stringified JSON object.\",\r\n [tokenRequestEmpty]: \"Token request was empty and not found in cache.\",\r\n [logoutRequestEmpty]: \"The logout request was null or undefined.\",\r\n [invalidCodeChallengeMethod]: 'code_challenge_method passed is invalid. Valid values are \"plain\" and \"S256\".',\r\n [pkceParamsMissing]: \"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request\",\r\n [invalidCloudDiscoveryMetadata]: \"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields\",\r\n [invalidAuthorityMetadata]: \"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.\",\r\n [untrustedAuthority]: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.\",\r\n [missingSshJwk]: \"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.\",\r\n [missingSshKid]: \"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.\",\r\n [missingNonceAuthenticationHeader]: \"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.\",\r\n [invalidAuthenticationHeader]: \"Invalid authentication header provided\",\r\n [cannotSetOIDCOptions]: \"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.\",\r\n [cannotAllowPlatformBroker]: \"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.\",\r\n [authorityMismatch]: \"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.\",\r\n};\r\n/**\r\n * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.\r\n * @deprecated Use ClientConfigurationErrorCodes instead\r\n */\r\nconst ClientConfigurationErrorMessage = {\r\n redirectUriNotSet: {\r\n code: redirectUriEmpty,\r\n desc: ClientConfigurationErrorMessages[redirectUriEmpty],\r\n },\r\n claimsRequestParsingError: {\r\n code: claimsRequestParsingError,\r\n desc: ClientConfigurationErrorMessages[claimsRequestParsingError],\r\n },\r\n authorityUriInsecure: {\r\n code: authorityUriInsecure,\r\n desc: ClientConfigurationErrorMessages[authorityUriInsecure],\r\n },\r\n urlParseError: {\r\n code: urlParseError,\r\n desc: ClientConfigurationErrorMessages[urlParseError],\r\n },\r\n urlEmptyError: {\r\n code: urlEmptyError,\r\n desc: ClientConfigurationErrorMessages[urlEmptyError],\r\n },\r\n emptyScopesError: {\r\n code: emptyInputScopesError,\r\n desc: ClientConfigurationErrorMessages[emptyInputScopesError],\r\n },\r\n invalidPrompt: {\r\n code: invalidPromptValue,\r\n desc: ClientConfigurationErrorMessages[invalidPromptValue],\r\n },\r\n invalidClaimsRequest: {\r\n code: invalidClaims,\r\n desc: ClientConfigurationErrorMessages[invalidClaims],\r\n },\r\n tokenRequestEmptyError: {\r\n code: tokenRequestEmpty,\r\n desc: ClientConfigurationErrorMessages[tokenRequestEmpty],\r\n },\r\n logoutRequestEmptyError: {\r\n code: logoutRequestEmpty,\r\n desc: ClientConfigurationErrorMessages[logoutRequestEmpty],\r\n },\r\n invalidCodeChallengeMethod: {\r\n code: invalidCodeChallengeMethod,\r\n desc: ClientConfigurationErrorMessages[invalidCodeChallengeMethod],\r\n },\r\n invalidCodeChallengeParams: {\r\n code: pkceParamsMissing,\r\n desc: ClientConfigurationErrorMessages[pkceParamsMissing],\r\n },\r\n invalidCloudDiscoveryMetadata: {\r\n code: invalidCloudDiscoveryMetadata,\r\n desc: ClientConfigurationErrorMessages[invalidCloudDiscoveryMetadata],\r\n },\r\n invalidAuthorityMetadata: {\r\n code: invalidAuthorityMetadata,\r\n desc: ClientConfigurationErrorMessages[invalidAuthorityMetadata],\r\n },\r\n untrustedAuthority: {\r\n code: untrustedAuthority,\r\n desc: ClientConfigurationErrorMessages[untrustedAuthority],\r\n },\r\n missingSshJwk: {\r\n code: missingSshJwk,\r\n desc: ClientConfigurationErrorMessages[missingSshJwk],\r\n },\r\n missingSshKid: {\r\n code: missingSshKid,\r\n desc: ClientConfigurationErrorMessages[missingSshKid],\r\n },\r\n missingNonceAuthenticationHeader: {\r\n code: missingNonceAuthenticationHeader,\r\n desc: ClientConfigurationErrorMessages[missingNonceAuthenticationHeader],\r\n },\r\n invalidAuthenticationHeader: {\r\n code: invalidAuthenticationHeader,\r\n desc: ClientConfigurationErrorMessages[invalidAuthenticationHeader],\r\n },\r\n cannotSetOIDCOptions: {\r\n code: cannotSetOIDCOptions,\r\n desc: ClientConfigurationErrorMessages[cannotSetOIDCOptions],\r\n },\r\n cannotAllowPlatformBroker: {\r\n code: cannotAllowPlatformBroker,\r\n desc: ClientConfigurationErrorMessages[cannotAllowPlatformBroker],\r\n },\r\n authorityMismatch: {\r\n code: authorityMismatch,\r\n desc: ClientConfigurationErrorMessages[authorityMismatch],\r\n },\r\n};\r\n/**\r\n * Error thrown when there is an error in configuration of the MSAL.js library.\r\n */\r\nclass ClientConfigurationError extends AuthError {\r\n constructor(errorCode) {\r\n super(errorCode, ClientConfigurationErrorMessages[errorCode]);\r\n this.name = \"ClientConfigurationError\";\r\n Object.setPrototypeOf(this, ClientConfigurationError.prototype);\r\n }\r\n}\r\nfunction createClientConfigurationError(errorCode) {\r\n return new ClientConfigurationError(errorCode);\r\n}\n\nexport { ClientConfigurationError, ClientConfigurationErrorMessage, ClientConfigurationErrorMessages, createClientConfigurationError };\n//# sourceMappingURL=ClientConfigurationError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * @hidden\r\n */\r\nclass StringUtils {\r\n /**\r\n * Check if stringified object is empty\r\n * @param strObj\r\n */\r\n static isEmptyObj(strObj) {\r\n if (strObj) {\r\n try {\r\n const obj = JSON.parse(strObj);\r\n return Object.keys(obj).length === 0;\r\n }\r\n catch (e) { }\r\n }\r\n return true;\r\n }\r\n static startsWith(str, search) {\r\n return str.indexOf(search) === 0;\r\n }\r\n static endsWith(str, search) {\r\n return (str.length >= search.length &&\r\n str.lastIndexOf(search) === str.length - search.length);\r\n }\r\n /**\r\n * Parses string into an object.\r\n *\r\n * @param query\r\n */\r\n static queryStringToObject(query) {\r\n const obj = {};\r\n const params = query.split(\"&\");\r\n const decode = (s) => decodeURIComponent(s.replace(/\\+/g, \" \"));\r\n params.forEach((pair) => {\r\n if (pair.trim()) {\r\n const [key, value] = pair.split(/=(.+)/g, 2); // Split on the first occurence of the '=' character\r\n if (key && value) {\r\n obj[decode(key)] = decode(value);\r\n }\r\n }\r\n });\r\n return obj;\r\n }\r\n /**\r\n * Trims entries in an array.\r\n *\r\n * @param arr\r\n */\r\n static trimArrayEntries(arr) {\r\n return arr.map((entry) => entry.trim());\r\n }\r\n /**\r\n * Removes empty strings from array\r\n * @param arr\r\n */\r\n static removeEmptyStringsFromArray(arr) {\r\n return arr.filter((entry) => {\r\n return !!entry;\r\n });\r\n }\r\n /**\r\n * Attempts to parse a string into JSON\r\n * @param str\r\n */\r\n static jsonParseHelper(str) {\r\n try {\r\n return JSON.parse(str);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n }\r\n /**\r\n * Tests if a given string matches a given pattern, with support for wildcards and queries.\r\n * @param pattern Wildcard pattern to string match. Supports \"*\" for wildcards and \"?\" for queries\r\n * @param input String to match against\r\n */\r\n static matchPattern(pattern, input) {\r\n /**\r\n * Wildcard support: https://stackoverflow.com/a/3117248/4888559\r\n * Queries: replaces \"?\" in string with escaped \"\\?\" for regex test\r\n */\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n const regex = new RegExp(pattern\r\n .replace(/\\\\/g, \"\\\\\\\\\")\r\n .replace(/\\*/g, \"[^ ]*\")\r\n .replace(/\\?/g, \"\\\\?\"));\r\n return regex.test(input);\r\n }\r\n}\n\nexport { StringUtils };\n//# sourceMappingURL=StringUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { StringUtils } from '../utils/StringUtils.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { Constants, OIDC_SCOPES } from '../utils/Constants.mjs';\nimport { emptyInputScopesError } from '../error/ClientConfigurationErrorCodes.mjs';\nimport { cannotAppendScopeSet, cannotRemoveEmptyScope, emptyInputScopeSet } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\r\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\r\n * to ensure uniqueness of strings.\r\n */\r\nclass ScopeSet {\r\n constructor(inputScopes) {\r\n // Filter empty string and null/undefined array items\r\n const scopeArr = inputScopes\r\n ? StringUtils.trimArrayEntries([...inputScopes])\r\n : [];\r\n const filteredInput = scopeArr\r\n ? StringUtils.removeEmptyStringsFromArray(scopeArr)\r\n : [];\r\n // Check if scopes array has at least one member\r\n if (!filteredInput || !filteredInput.length) {\r\n throw createClientConfigurationError(emptyInputScopesError);\r\n }\r\n this.scopes = new Set(); // Iterator in constructor not supported by IE11\r\n filteredInput.forEach((scope) => this.scopes.add(scope));\r\n }\r\n /**\r\n * Factory method to create ScopeSet from space-delimited string\r\n * @param inputScopeString\r\n * @param appClientId\r\n * @param scopesRequired\r\n */\r\n static fromString(inputScopeString) {\r\n const scopeString = inputScopeString || Constants.EMPTY_STRING;\r\n const inputScopes = scopeString.split(\" \");\r\n return new ScopeSet(inputScopes);\r\n }\r\n /**\r\n * Creates the set of scopes to search for in cache lookups\r\n * @param inputScopeString\r\n * @returns\r\n */\r\n static createSearchScopes(inputScopeString) {\r\n const scopeSet = new ScopeSet(inputScopeString);\r\n if (!scopeSet.containsOnlyOIDCScopes()) {\r\n scopeSet.removeOIDCScopes();\r\n }\r\n else {\r\n scopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);\r\n }\r\n return scopeSet;\r\n }\r\n /**\r\n * Check if a given scope is present in this set of scopes.\r\n * @param scope\r\n */\r\n containsScope(scope) {\r\n const lowerCaseScopes = this.printScopesLowerCase().split(\" \");\r\n const lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\r\n // compare lowercase scopes\r\n return scope\r\n ? lowerCaseScopesSet.scopes.has(scope.toLowerCase())\r\n : false;\r\n }\r\n /**\r\n * Check if a set of scopes is present in this set of scopes.\r\n * @param scopeSet\r\n */\r\n containsScopeSet(scopeSet) {\r\n if (!scopeSet || scopeSet.scopes.size <= 0) {\r\n return false;\r\n }\r\n return (this.scopes.size >= scopeSet.scopes.size &&\r\n scopeSet.asArray().every((scope) => this.containsScope(scope)));\r\n }\r\n /**\r\n * Check if set of scopes contains only the defaults\r\n */\r\n containsOnlyOIDCScopes() {\r\n let defaultScopeCount = 0;\r\n OIDC_SCOPES.forEach((defaultScope) => {\r\n if (this.containsScope(defaultScope)) {\r\n defaultScopeCount += 1;\r\n }\r\n });\r\n return this.scopes.size === defaultScopeCount;\r\n }\r\n /**\r\n * Appends single scope if passed\r\n * @param newScope\r\n */\r\n appendScope(newScope) {\r\n if (newScope) {\r\n this.scopes.add(newScope.trim());\r\n }\r\n }\r\n /**\r\n * Appends multiple scopes if passed\r\n * @param newScopes\r\n */\r\n appendScopes(newScopes) {\r\n try {\r\n newScopes.forEach((newScope) => this.appendScope(newScope));\r\n }\r\n catch (e) {\r\n throw createClientAuthError(cannotAppendScopeSet);\r\n }\r\n }\r\n /**\r\n * Removes element from set of scopes.\r\n * @param scope\r\n */\r\n removeScope(scope) {\r\n if (!scope) {\r\n throw createClientAuthError(cannotRemoveEmptyScope);\r\n }\r\n this.scopes.delete(scope.trim());\r\n }\r\n /**\r\n * Removes default scopes from set of scopes\r\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\r\n */\r\n removeOIDCScopes() {\r\n OIDC_SCOPES.forEach((defaultScope) => {\r\n this.scopes.delete(defaultScope);\r\n });\r\n }\r\n /**\r\n * Combines an array of scopes with the current set of scopes.\r\n * @param otherScopes\r\n */\r\n unionScopeSets(otherScopes) {\r\n if (!otherScopes) {\r\n throw createClientAuthError(emptyInputScopeSet);\r\n }\r\n const unionScopes = new Set(); // Iterator in constructor not supported in IE11\r\n otherScopes.scopes.forEach((scope) => unionScopes.add(scope.toLowerCase()));\r\n this.scopes.forEach((scope) => unionScopes.add(scope.toLowerCase()));\r\n return unionScopes;\r\n }\r\n /**\r\n * Check if scopes intersect between this set and another.\r\n * @param otherScopes\r\n */\r\n intersectingScopeSets(otherScopes) {\r\n if (!otherScopes) {\r\n throw createClientAuthError(emptyInputScopeSet);\r\n }\r\n // Do not allow OIDC scopes to be the only intersecting scopes\r\n if (!otherScopes.containsOnlyOIDCScopes()) {\r\n otherScopes.removeOIDCScopes();\r\n }\r\n const unionScopes = this.unionScopeSets(otherScopes);\r\n const sizeOtherScopes = otherScopes.getScopeCount();\r\n const sizeThisScopes = this.getScopeCount();\r\n const sizeUnionScopes = unionScopes.size;\r\n return sizeUnionScopes < sizeThisScopes + sizeOtherScopes;\r\n }\r\n /**\r\n * Returns size of set of scopes.\r\n */\r\n getScopeCount() {\r\n return this.scopes.size;\r\n }\r\n /**\r\n * Returns the scopes as an array of string values\r\n */\r\n asArray() {\r\n const array = [];\r\n this.scopes.forEach((val) => array.push(val));\r\n return array;\r\n }\r\n /**\r\n * Prints scopes into a space-delimited string\r\n */\r\n printScopes() {\r\n if (this.scopes) {\r\n const scopeArr = this.asArray();\r\n return scopeArr.join(\" \");\r\n }\r\n return Constants.EMPTY_STRING;\r\n }\r\n /**\r\n * Prints scopes into a space-delimited lower-case string (used for caching)\r\n */\r\n printScopesLowerCase() {\r\n return this.printScopes().toLowerCase();\r\n }\r\n}\n\nexport { ScopeSet };\n//# sourceMappingURL=ScopeSet.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { Separators, Constants } from '../utils/Constants.mjs';\nimport { clientInfoEmptyError, clientInfoDecodingError } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Function to build a client info object from server clientInfo string\r\n * @param rawClientInfo\r\n * @param crypto\r\n */\r\nfunction buildClientInfo(rawClientInfo, base64Decode) {\r\n if (!rawClientInfo) {\r\n throw createClientAuthError(clientInfoEmptyError);\r\n }\r\n try {\r\n const decodedClientInfo = base64Decode(rawClientInfo);\r\n return JSON.parse(decodedClientInfo);\r\n }\r\n catch (e) {\r\n throw createClientAuthError(clientInfoDecodingError);\r\n }\r\n}\r\n/**\r\n * Function to build a client info object from cached homeAccountId string\r\n * @param homeAccountId\r\n */\r\nfunction buildClientInfoFromHomeAccountId(homeAccountId) {\r\n if (!homeAccountId) {\r\n throw createClientAuthError(clientInfoDecodingError);\r\n }\r\n const clientInfoParts = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\r\n return {\r\n uid: clientInfoParts[0],\r\n utid: clientInfoParts.length < 2\r\n ? Constants.EMPTY_STRING\r\n : clientInfoParts[1],\r\n };\r\n}\n\nexport { buildClientInfo, buildClientInfoFromHomeAccountId };\n//# sourceMappingURL=ClientInfo.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns true if tenantId matches the utid portion of homeAccountId\r\n * @param tenantId\r\n * @param homeAccountId\r\n * @returns\r\n */\r\nfunction tenantIdMatchesHomeTenant(tenantId, homeAccountId) {\r\n return (!!tenantId &&\r\n !!homeAccountId &&\r\n tenantId === homeAccountId.split(\".\")[1]);\r\n}\r\n/**\r\n * Build tenant profile\r\n * @param homeAccountId - Home account identifier for this account object\r\n * @param localAccountId - Local account identifer for this account object\r\n * @param tenantId - Full tenant or organizational id that this account belongs to\r\n * @param idTokenClaims - Claims from the ID token\r\n * @returns\r\n */\r\nfunction buildTenantProfile(homeAccountId, localAccountId, tenantId, idTokenClaims) {\r\n if (idTokenClaims) {\r\n const { oid, sub, tid, name, tfp, acr } = idTokenClaims;\r\n /**\r\n * Since there is no way to determine if the authority is AAD or B2C, we exhaust all the possible claims that can serve as tenant ID with the following precedence:\r\n * tid - TenantID claim that identifies the tenant that issued the token in AAD. Expected in all AAD ID tokens, not present in B2C ID Tokens.\r\n * tfp - Trust Framework Policy claim that identifies the policy that was used to authenticate the user. Functions as tenant for B2C scenarios.\r\n * acr - Authentication Context Class Reference claim used only with older B2C policies. Fallback in case tfp is not present, but likely won't be present anyway.\r\n */\r\n const tenantId = tid || tfp || acr || \"\";\r\n return {\r\n tenantId: tenantId,\r\n localAccountId: oid || sub || \"\",\r\n name: name,\r\n isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),\r\n };\r\n }\r\n else {\r\n return {\r\n tenantId,\r\n localAccountId,\r\n isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),\r\n };\r\n }\r\n}\r\n/**\r\n * Replaces account info that varies by tenant profile sourced from the ID token claims passed in with the tenant-specific account info\r\n * @param baseAccountInfo\r\n * @param idTokenClaims\r\n * @returns\r\n */\r\nfunction updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims, idTokenSecret) {\r\n let updatedAccountInfo = baseAccountInfo;\r\n // Tenant Profile overrides passed in account info\r\n if (tenantProfile) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { isHomeTenant, ...tenantProfileOverride } = tenantProfile;\r\n updatedAccountInfo = { ...baseAccountInfo, ...tenantProfileOverride };\r\n }\r\n // ID token claims override passed in account info and tenant profile\r\n if (idTokenClaims) {\r\n // Ignore isHomeTenant, loginHint, and sid which are part of tenant profile but not base account info\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfile(baseAccountInfo.homeAccountId, baseAccountInfo.localAccountId, baseAccountInfo.tenantId, idTokenClaims);\r\n updatedAccountInfo = {\r\n ...updatedAccountInfo,\r\n ...claimsSourcedTenantProfile,\r\n idTokenClaims: idTokenClaims,\r\n idToken: idTokenSecret,\r\n };\r\n return updatedAccountInfo;\r\n }\r\n return updatedAccountInfo;\r\n}\n\nexport { buildTenantProfile, tenantIdMatchesHomeTenant, updateAccountTenantProfileData };\n//# sourceMappingURL=AccountInfo.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Authority types supported by MSAL.\r\n */\r\nconst AuthorityType = {\r\n Default: 0,\r\n Adfs: 1,\r\n Dsts: 2,\r\n Ciam: 3,\r\n};\n\nexport { AuthorityType };\n//# sourceMappingURL=AuthorityType.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Gets tenantId from available ID token claims to set as credential realm with the following precedence:\r\n * 1. tid - if the token is acquired from an Azure AD tenant tid will be present\r\n * 2. tfp - if the token is acquired from a modern B2C tenant tfp should be present\r\n * 3. acr - if the token is acquired from a legacy B2C tenant acr should be present\r\n * Downcased to match the realm case-insensitive comparison requirements\r\n * @param idTokenClaims\r\n * @returns\r\n */\r\nfunction getTenantIdFromIdTokenClaims(idTokenClaims) {\r\n if (idTokenClaims) {\r\n const tenantId = idTokenClaims.tid || idTokenClaims.tfp || idTokenClaims.acr;\r\n return tenantId || null;\r\n }\r\n return null;\r\n}\n\nexport { getTenantIdFromIdTokenClaims };\n//# sourceMappingURL=TokenClaims.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Protocol modes supported by MSAL.\r\n */\r\nconst ProtocolMode = {\r\n AAD: \"AAD\",\r\n OIDC: \"OIDC\",\r\n};\n\nexport { ProtocolMode };\n//# sourceMappingURL=ProtocolMode.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Separators, CacheAccountType } from '../../utils/Constants.mjs';\nimport { buildClientInfo } from '../../account/ClientInfo.mjs';\nimport { buildTenantProfile } from '../../account/AccountInfo.mjs';\nimport { createClientAuthError } from '../../error/ClientAuthError.mjs';\nimport { AuthorityType } from '../../authority/AuthorityType.mjs';\nimport { getTenantIdFromIdTokenClaims } from '../../account/TokenClaims.mjs';\nimport { ProtocolMode } from '../../authority/ProtocolMode.mjs';\nimport { invalidCacheEnvironment } from '../../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\r\n *\r\n * Key : Value Schema\r\n *\r\n * Key: --\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\r\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\r\n * authorityType: Accounts authority type as a string\r\n * name: Full name for the account, including given name and family name,\r\n * lastModificationTime: last time this entity was modified in the cache\r\n * lastModificationApp:\r\n * nativeAccountId: Account identifier on the native device\r\n * tenantProfiles: Array of tenant profile objects for each tenant that the account has authenticated with in the browser\r\n * }\r\n * @internal\r\n */\r\nclass AccountEntity {\r\n /**\r\n * Generate Account Id key component as per the schema: -\r\n */\r\n generateAccountId() {\r\n const accountId = [this.homeAccountId, this.environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n /**\r\n * Generate Account Cache Key as per the schema: --\r\n */\r\n generateAccountKey() {\r\n return AccountEntity.generateAccountCacheKey({\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId,\r\n });\r\n }\r\n /**\r\n * Returns the AccountInfo interface for this account.\r\n */\r\n getAccountInfo() {\r\n return {\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId,\r\n name: this.name,\r\n nativeAccountId: this.nativeAccountId,\r\n authorityType: this.authorityType,\r\n // Deserialize tenant profiles array into a Map\r\n tenantProfiles: new Map((this.tenantProfiles || []).map((tenantProfile) => {\r\n return [tenantProfile.tenantId, tenantProfile];\r\n })),\r\n };\r\n }\r\n /**\r\n * Returns true if the account entity is in single tenant format (outdated), false otherwise\r\n */\r\n isSingleTenant() {\r\n return !this.tenantProfiles;\r\n }\r\n /**\r\n * Generates account key from interface\r\n * @param accountInterface\r\n */\r\n static generateAccountCacheKey(accountInterface) {\r\n const homeTenantId = accountInterface.homeAccountId.split(\".\")[1];\r\n const accountKey = [\r\n accountInterface.homeAccountId,\r\n accountInterface.environment || \"\",\r\n homeTenantId || accountInterface.tenantId || \"\",\r\n ];\r\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n /**\r\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\r\n * @param accountDetails\r\n */\r\n static createAccount(accountDetails, authority, base64Decode) {\r\n const account = new AccountEntity();\r\n if (authority.authorityType === AuthorityType.Adfs) {\r\n account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;\r\n }\r\n else if (authority.protocolMode === ProtocolMode.AAD) {\r\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\r\n }\r\n else {\r\n account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;\r\n }\r\n let clientInfo;\r\n if (accountDetails.clientInfo && base64Decode) {\r\n clientInfo = buildClientInfo(accountDetails.clientInfo, base64Decode);\r\n }\r\n account.clientInfo = accountDetails.clientInfo;\r\n account.homeAccountId = accountDetails.homeAccountId;\r\n account.nativeAccountId = accountDetails.nativeAccountId;\r\n const env = accountDetails.environment ||\r\n (authority && authority.getPreferredCache());\r\n if (!env) {\r\n throw createClientAuthError(invalidCacheEnvironment);\r\n }\r\n account.environment = env;\r\n // non AAD scenarios can have empty realm\r\n account.realm =\r\n clientInfo?.utid ||\r\n getTenantIdFromIdTokenClaims(accountDetails.idTokenClaims) ||\r\n \"\";\r\n // How do you account for MSA CID here?\r\n account.localAccountId =\r\n clientInfo?.uid ||\r\n accountDetails.idTokenClaims?.oid ||\r\n accountDetails.idTokenClaims?.sub ||\r\n \"\";\r\n /*\r\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.\r\n * In most cases it will contain a single email. This field should not be relied upon if a custom\r\n * policy is configured to return more than 1 email.\r\n */\r\n const preferredUsername = accountDetails.idTokenClaims?.preferred_username ||\r\n accountDetails.idTokenClaims?.upn;\r\n const email = accountDetails.idTokenClaims?.emails\r\n ? accountDetails.idTokenClaims.emails[0]\r\n : null;\r\n account.username = preferredUsername || email || \"\";\r\n account.name = accountDetails.idTokenClaims?.name || \"\";\r\n account.cloudGraphHostName = accountDetails.cloudGraphHostName;\r\n account.msGraphHost = accountDetails.msGraphHost;\r\n if (accountDetails.tenantProfiles) {\r\n account.tenantProfiles = accountDetails.tenantProfiles;\r\n }\r\n else {\r\n const tenantProfile = buildTenantProfile(accountDetails.homeAccountId, account.localAccountId, account.realm, accountDetails.idTokenClaims);\r\n account.tenantProfiles = [tenantProfile];\r\n }\r\n return account;\r\n }\r\n /**\r\n * Creates an AccountEntity object from AccountInfo\r\n * @param accountInfo\r\n * @param cloudGraphHostName\r\n * @param msGraphHost\r\n * @returns\r\n */\r\n static createFromAccountInfo(accountInfo, cloudGraphHostName, msGraphHost) {\r\n const account = new AccountEntity();\r\n account.authorityType =\r\n accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;\r\n account.homeAccountId = accountInfo.homeAccountId;\r\n account.localAccountId = accountInfo.localAccountId;\r\n account.nativeAccountId = accountInfo.nativeAccountId;\r\n account.realm = accountInfo.tenantId;\r\n account.environment = accountInfo.environment;\r\n account.username = accountInfo.username;\r\n account.name = accountInfo.name;\r\n account.cloudGraphHostName = cloudGraphHostName;\r\n account.msGraphHost = msGraphHost;\r\n // Serialize tenant profiles map into an array\r\n account.tenantProfiles = Array.from(accountInfo.tenantProfiles?.values() || []);\r\n return account;\r\n }\r\n /**\r\n * Generate HomeAccountId from server response\r\n * @param serverClientInfo\r\n * @param authType\r\n */\r\n static generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {\r\n // since ADFS/DSTS do not have tid and does not set client_info\r\n if (!(authType === AuthorityType.Adfs ||\r\n authType === AuthorityType.Dsts)) {\r\n // for cases where there is clientInfo\r\n if (serverClientInfo) {\r\n try {\r\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj.base64Decode);\r\n if (clientInfo.uid && clientInfo.utid) {\r\n return `${clientInfo.uid}.${clientInfo.utid}`;\r\n }\r\n }\r\n catch (e) { }\r\n }\r\n logger.warning(\"No client info in response\");\r\n }\r\n // default to \"sub\" claim\r\n return idTokenClaims?.sub || \"\";\r\n }\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isAccountEntity(entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"localAccountId\") &&\r\n entity.hasOwnProperty(\"username\") &&\r\n entity.hasOwnProperty(\"authorityType\"));\r\n }\r\n /**\r\n * Helper function to determine whether 2 accountInfo objects represent the same account\r\n * @param accountA\r\n * @param accountB\r\n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\r\n */\r\n static accountInfoIsEqual(accountA, accountB, compareClaims) {\r\n if (!accountA || !accountB) {\r\n return false;\r\n }\r\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\r\n if (compareClaims) {\r\n const accountAClaims = (accountA.idTokenClaims ||\r\n {});\r\n const accountBClaims = (accountB.idTokenClaims ||\r\n {});\r\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\r\n claimsMatch =\r\n accountAClaims.iat === accountBClaims.iat &&\r\n accountAClaims.nonce === accountBClaims.nonce;\r\n }\r\n return (accountA.homeAccountId === accountB.homeAccountId &&\r\n accountA.localAccountId === accountB.localAccountId &&\r\n accountA.username === accountB.username &&\r\n accountA.tenantId === accountB.tenantId &&\r\n accountA.environment === accountB.environment &&\r\n accountA.nativeAccountId === accountB.nativeAccountId &&\r\n claimsMatch);\r\n }\r\n}\n\nexport { AccountEntity };\n//# sourceMappingURL=AccountEntity.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { hashNotDeserialized } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Parses hash string from given string. Returns empty string if no hash symbol is found.\r\n * @param hashString\r\n */\r\nfunction stripLeadingHashOrQuery(responseString) {\r\n if (responseString.startsWith(\"#/\")) {\r\n return responseString.substring(2);\r\n }\r\n else if (responseString.startsWith(\"#\") ||\r\n responseString.startsWith(\"?\")) {\r\n return responseString.substring(1);\r\n }\r\n return responseString;\r\n}\r\n/**\r\n * Returns URL hash as server auth code response object.\r\n */\r\nfunction getDeserializedResponse(responseString) {\r\n // Check if given hash is empty\r\n if (!responseString || responseString.indexOf(\"=\") < 0) {\r\n return null;\r\n }\r\n try {\r\n // Strip the # or ? symbol if present\r\n const normalizedResponse = stripLeadingHashOrQuery(responseString);\r\n // If # symbol was not present, above will return empty string, so give original hash value\r\n const deserializedHash = Object.fromEntries(new URLSearchParams(normalizedResponse));\r\n // Check for known response properties\r\n if (deserializedHash.code ||\r\n deserializedHash.error ||\r\n deserializedHash.error_description ||\r\n deserializedHash.state) {\r\n return deserializedHash;\r\n }\r\n }\r\n catch (e) {\r\n throw createClientAuthError(hashNotDeserialized);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Utility to create a URL from the params map\r\n */\r\nfunction mapToQueryString(parameters) {\r\n const queryParameterArray = new Array();\r\n parameters.forEach((value, key) => {\r\n queryParameterArray.push(`${key}=${encodeURIComponent(value)}`);\r\n });\r\n return queryParameterArray.join(\"&\");\r\n}\n\nexport { getDeserializedResponse, mapToQueryString, stripLeadingHashOrQuery };\n//# sourceMappingURL=UrlUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { StringUtils } from '../utils/StringUtils.mjs';\nimport { AADAuthorityConstants, Constants } from '../utils/Constants.mjs';\nimport { getDeserializedResponse } from '../utils/UrlUtils.mjs';\nimport { urlEmptyError, urlParseError, authorityUriInsecure } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Url object class which can perform various transformations on url strings.\r\n */\r\nclass UrlString {\r\n get urlString() {\r\n return this._urlString;\r\n }\r\n constructor(url) {\r\n this._urlString = url;\r\n if (!this._urlString) {\r\n // Throws error if url is empty\r\n throw createClientConfigurationError(urlEmptyError);\r\n }\r\n if (!url.includes(\"#\")) {\r\n this._urlString = UrlString.canonicalizeUri(url);\r\n }\r\n }\r\n /**\r\n * Ensure urls are lower case and end with a / character.\r\n * @param url\r\n */\r\n static canonicalizeUri(url) {\r\n if (url) {\r\n let lowerCaseUrl = url.toLowerCase();\r\n if (StringUtils.endsWith(lowerCaseUrl, \"?\")) {\r\n lowerCaseUrl = lowerCaseUrl.slice(0, -1);\r\n }\r\n else if (StringUtils.endsWith(lowerCaseUrl, \"?/\")) {\r\n lowerCaseUrl = lowerCaseUrl.slice(0, -2);\r\n }\r\n if (!StringUtils.endsWith(lowerCaseUrl, \"/\")) {\r\n lowerCaseUrl += \"/\";\r\n }\r\n return lowerCaseUrl;\r\n }\r\n return url;\r\n }\r\n /**\r\n * Throws if urlString passed is not a valid authority URI string.\r\n */\r\n validateAsUri() {\r\n // Attempts to parse url for uri components\r\n let components;\r\n try {\r\n components = this.getUrlComponents();\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(urlParseError);\r\n }\r\n // Throw error if URI or path segments are not parseable.\r\n if (!components.HostNameAndPort || !components.PathSegments) {\r\n throw createClientConfigurationError(urlParseError);\r\n }\r\n // Throw error if uri is insecure.\r\n if (!components.Protocol ||\r\n components.Protocol.toLowerCase() !== \"https:\") {\r\n throw createClientConfigurationError(authorityUriInsecure);\r\n }\r\n }\r\n /**\r\n * Given a url and a query string return the url with provided query string appended\r\n * @param url\r\n * @param queryString\r\n */\r\n static appendQueryString(url, queryString) {\r\n if (!queryString) {\r\n return url;\r\n }\r\n return url.indexOf(\"?\") < 0\r\n ? `${url}?${queryString}`\r\n : `${url}&${queryString}`;\r\n }\r\n /**\r\n * Returns a url with the hash removed\r\n * @param url\r\n */\r\n static removeHashFromUrl(url) {\r\n return UrlString.canonicalizeUri(url.split(\"#\")[0]);\r\n }\r\n /**\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n replaceTenantPath(tenantId) {\r\n const urlObject = this.getUrlComponents();\r\n const pathArray = urlObject.PathSegments;\r\n if (tenantId &&\r\n pathArray.length !== 0 &&\r\n (pathArray[0] === AADAuthorityConstants.COMMON ||\r\n pathArray[0] === AADAuthorityConstants.ORGANIZATIONS)) {\r\n pathArray[0] = tenantId;\r\n }\r\n return UrlString.constructAuthorityUriFromObject(urlObject);\r\n }\r\n /**\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n getUrlComponents() {\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n const regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n // If url string does not match regEx, we throw an error\r\n const match = this.urlString.match(regEx);\r\n if (!match) {\r\n throw createClientConfigurationError(urlParseError);\r\n }\r\n // Url component object\r\n const urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5],\r\n QueryString: match[7],\r\n };\r\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n if (urlComponents.QueryString &&\r\n urlComponents.QueryString.endsWith(\"/\")) {\r\n urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length - 1);\r\n }\r\n return urlComponents;\r\n }\r\n static getDomainFromUrl(url) {\r\n const regEx = RegExp(\"^([^:/?#]+://)?([^/?#]*)\");\r\n const match = url.match(regEx);\r\n if (!match) {\r\n throw createClientConfigurationError(urlParseError);\r\n }\r\n return match[2];\r\n }\r\n static getAbsoluteUrl(relativeUrl, baseUrl) {\r\n if (relativeUrl[0] === Constants.FORWARD_SLASH) {\r\n const url = new UrlString(baseUrl);\r\n const baseComponents = url.getUrlComponents();\r\n return (baseComponents.Protocol +\r\n \"//\" +\r\n baseComponents.HostNameAndPort +\r\n relativeUrl);\r\n }\r\n return relativeUrl;\r\n }\r\n static constructAuthorityUriFromObject(urlObject) {\r\n return new UrlString(urlObject.Protocol +\r\n \"//\" +\r\n urlObject.HostNameAndPort +\r\n \"/\" +\r\n urlObject.PathSegments.join(\"/\"));\r\n }\r\n /**\r\n * Check if the hash of the URL string contains known properties\r\n * @deprecated This API will be removed in a future version\r\n */\r\n static hashContainsKnownProperties(response) {\r\n return !!getDeserializedResponse(response);\r\n }\r\n}\n\nexport { UrlString };\n//# sourceMappingURL=UrlString.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { AuthorityMetadataSource } from '../utils/Constants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst rawMetdataJSON = {\r\n endpointMetadata: {\r\n \"login.microsoftonline.com\": {\r\n token_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.microsoftonline.com/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n \"login.chinacloudapi.cn\": {\r\n token_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.partner.microsoftonline.cn/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n \"login.microsoftonline.us\": {\r\n token_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.microsoftonline.us/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n },\r\n instanceDiscoveryMetadata: {\r\n tenant_discovery_endpoint: \"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration\",\r\n metadata: [\r\n {\r\n preferred_network: \"login.microsoftonline.com\",\r\n preferred_cache: \"login.windows.net\",\r\n aliases: [\r\n \"login.microsoftonline.com\",\r\n \"login.windows.net\",\r\n \"login.microsoft.com\",\r\n \"sts.windows.net\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login.partner.microsoftonline.cn\",\r\n preferred_cache: \"login.partner.microsoftonline.cn\",\r\n aliases: [\r\n \"login.partner.microsoftonline.cn\",\r\n \"login.chinacloudapi.cn\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login.microsoftonline.de\",\r\n preferred_cache: \"login.microsoftonline.de\",\r\n aliases: [\"login.microsoftonline.de\"],\r\n },\r\n {\r\n preferred_network: \"login.microsoftonline.us\",\r\n preferred_cache: \"login.microsoftonline.us\",\r\n aliases: [\r\n \"login.microsoftonline.us\",\r\n \"login.usgovcloudapi.net\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login-us.microsoftonline.com\",\r\n preferred_cache: \"login-us.microsoftonline.com\",\r\n aliases: [\"login-us.microsoftonline.com\"],\r\n },\r\n ],\r\n },\r\n};\r\nconst EndpointMetadata = rawMetdataJSON.endpointMetadata;\r\nconst InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;\r\nconst InstanceDiscoveryMetadataAliases = new Set();\r\nInstanceDiscoveryMetadata.metadata.forEach((metadataEntry) => {\r\n metadataEntry.aliases.forEach((alias) => {\r\n InstanceDiscoveryMetadataAliases.add(alias);\r\n });\r\n});\r\n/**\r\n * Attempts to get an aliases array from the static authority metadata sources based on the canonical authority host\r\n * @param staticAuthorityOptions\r\n * @param logger\r\n * @returns\r\n */\r\nfunction getAliasesFromStaticSources(staticAuthorityOptions, logger) {\r\n let staticAliases;\r\n const canonicalAuthority = staticAuthorityOptions.canonicalAuthority;\r\n if (canonicalAuthority) {\r\n const authorityHost = new UrlString(canonicalAuthority).getUrlComponents().HostNameAndPort;\r\n staticAliases =\r\n getAliasesFromMetadata(authorityHost, staticAuthorityOptions.cloudDiscoveryMetadata?.metadata, AuthorityMetadataSource.CONFIG, logger) ||\r\n getAliasesFromMetadata(authorityHost, InstanceDiscoveryMetadata.metadata, AuthorityMetadataSource.HARDCODED_VALUES, logger) ||\r\n staticAuthorityOptions.knownAuthorities;\r\n }\r\n return staticAliases || [];\r\n}\r\n/**\r\n * Returns aliases for from the raw cloud discovery metadata passed in\r\n * @param authorityHost\r\n * @param rawCloudDiscoveryMetadata\r\n * @returns\r\n */\r\nfunction getAliasesFromMetadata(authorityHost, cloudDiscoveryMetadata, source, logger) {\r\n logger?.trace(`getAliasesFromMetadata called with source: ${source}`);\r\n if (authorityHost && cloudDiscoveryMetadata) {\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(cloudDiscoveryMetadata, authorityHost);\r\n if (metadata) {\r\n logger?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${source}, returning aliases`);\r\n return metadata.aliases;\r\n }\r\n else {\r\n logger?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${source}`);\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Get cloud discovery metadata for common authorities\r\n */\r\nfunction getCloudDiscoveryMetadataFromHardcodedValues(authorityHost) {\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(InstanceDiscoveryMetadata.metadata, authorityHost);\r\n return metadata;\r\n}\r\n/**\r\n * Searches instance discovery network response for the entry that contains the host in the aliases list\r\n * @param response\r\n * @param authority\r\n */\r\nfunction getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {\r\n for (let i = 0; i < response.length; i++) {\r\n const metadata = response[i];\r\n if (metadata.aliases.includes(authorityHost)) {\r\n return metadata;\r\n }\r\n }\r\n return null;\r\n}\n\nexport { EndpointMetadata, InstanceDiscoveryMetadata, InstanceDiscoveryMetadataAliases, getAliasesFromMetadata, getAliasesFromStaticSources, getCloudDiscoveryMetadataFromHardcodedValues, getCloudDiscoveryMetadataFromNetworkResponse, rawMetdataJSON };\n//# sourceMappingURL=AuthorityMetadata.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst cacheQuotaExceededErrorCode = \"cache_quota_exceeded\";\r\nconst cacheUnknownErrorCode = \"cache_error_unknown\";\n\nexport { cacheQuotaExceededErrorCode, cacheUnknownErrorCode };\n//# sourceMappingURL=CacheErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { cacheUnknownErrorCode, cacheQuotaExceededErrorCode } from './CacheErrorCodes.mjs';\nimport * as CacheErrorCodes from './CacheErrorCodes.mjs';\nexport { CacheErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst CacheErrorMessages = {\r\n [cacheQuotaExceededErrorCode]: \"Exceeded cache storage capacity.\",\r\n [cacheUnknownErrorCode]: \"Unexpected error occurred when using cache storage.\",\r\n};\r\n/**\r\n * Error thrown when there is an error with the cache\r\n */\r\nclass CacheError extends Error {\r\n constructor(errorCode, errorMessage) {\r\n const message = errorMessage ||\r\n (CacheErrorMessages[errorCode]\r\n ? CacheErrorMessages[errorCode]\r\n : CacheErrorMessages[cacheUnknownErrorCode]);\r\n super(`${errorCode}: ${message}`);\r\n Object.setPrototypeOf(this, CacheError.prototype);\r\n this.name = \"CacheError\";\r\n this.errorCode = errorCode;\r\n this.errorMessage = message;\r\n }\r\n}\n\nexport { CacheError, CacheErrorMessages };\n//# sourceMappingURL=CacheError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Separators, CredentialType, AuthenticationScheme, THE_FAMILY_ID, APP_METADATA, AUTHORITY_METADATA_CONSTANTS } from '../utils/Constants.mjs';\nimport { generateCredentialKey } from './utils/CacheHelpers.mjs';\nimport { ScopeSet } from '../request/ScopeSet.mjs';\nimport { AccountEntity } from './entities/AccountEntity.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { updateAccountTenantProfileData } from '../account/AccountInfo.mjs';\nimport { extractTokenClaims } from '../account/AuthToken.mjs';\nimport { name, version } from '../packageMetadata.mjs';\nimport { getAliasesFromStaticSources } from '../authority/AuthorityMetadata.mjs';\nimport { CacheError } from '../error/CacheError.mjs';\nimport { invalidCacheRecord, bindingKeyNotRemoved, multipleMatchingAppMetadata, methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';\nimport { cacheQuotaExceededErrorCode, cacheUnknownErrorCode } from '../error/CacheErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.\r\n * @internal\r\n */\r\nclass CacheManager {\r\n constructor(clientId, cryptoImpl, logger, staticAuthorityOptions) {\r\n this.clientId = clientId;\r\n this.cryptoImpl = cryptoImpl;\r\n this.commonLogger = logger.clone(name, version);\r\n this.staticAuthorityOptions = staticAuthorityOptions;\r\n }\r\n /**\r\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\r\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\r\n * @returns Array of AccountInfo objects in cache\r\n */\r\n getAllAccounts(accountFilter) {\r\n return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter || {}), accountFilter);\r\n }\r\n /**\r\n * Gets first tenanted AccountInfo object found based on provided filters\r\n */\r\n getAccountInfoFilteredBy(accountFilter) {\r\n const allAccounts = this.getAllAccounts(accountFilter);\r\n if (allAccounts.length > 1) {\r\n // If one or more accounts are found, prioritize accounts that have an ID token\r\n const sortedAccounts = allAccounts.sort((account) => {\r\n return account.idTokenClaims ? -1 : 1;\r\n });\r\n return sortedAccounts[0];\r\n }\r\n else if (allAccounts.length === 1) {\r\n // If only one account is found, return it regardless of whether a matching ID token was found\r\n return allAccounts[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n /**\r\n * Returns a single matching\r\n * @param accountFilter\r\n * @returns\r\n */\r\n getBaseAccountInfo(accountFilter) {\r\n const accountEntities = this.getAccountsFilteredBy(accountFilter);\r\n if (accountEntities.length > 0) {\r\n return accountEntities[0].getAccountInfo();\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n /**\r\n * Matches filtered account entities with cached ID tokens that match the tenant profile-specific account filters\r\n * and builds the account info objects from the matching ID token's claims\r\n * @param cachedAccounts\r\n * @param accountFilter\r\n * @returns Array of AccountInfo objects that match account and tenant profile filters\r\n */\r\n buildTenantProfiles(cachedAccounts, accountFilter) {\r\n return cachedAccounts.flatMap((accountEntity) => {\r\n return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);\r\n });\r\n }\r\n getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {\r\n let tenantedAccountInfo = null;\r\n let idTokenClaims;\r\n if (tenantProfileFilter) {\r\n if (!this.tenantProfileMatchesFilter(tenantProfile, tenantProfileFilter)) {\r\n return null;\r\n }\r\n }\r\n const idToken = this.getIdToken(accountInfo, tokenKeys, tenantProfile.tenantId);\r\n if (idToken) {\r\n idTokenClaims = extractTokenClaims(idToken.secret, this.cryptoImpl.base64Decode);\r\n if (!this.idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter)) {\r\n // ID token sourced claims don't match so this tenant profile is not a match\r\n return null;\r\n }\r\n }\r\n // Expand tenant profile into account info based on matching tenant profile and if available matching ID token claims\r\n tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);\r\n return tenantedAccountInfo;\r\n }\r\n getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {\r\n const accountInfo = accountEntity.getAccountInfo();\r\n let searchTenantProfiles = accountInfo.tenantProfiles || new Map();\r\n const tokenKeys = this.getTokenKeys();\r\n // If a tenant ID was provided, only return the tenant profile for that tenant ID if it exists\r\n if (targetTenantId) {\r\n const tenantProfile = searchTenantProfiles.get(targetTenantId);\r\n if (tenantProfile) {\r\n // Reduce search field to just this tenant profile\r\n searchTenantProfiles = new Map([\r\n [targetTenantId, tenantProfile],\r\n ]);\r\n }\r\n else {\r\n // No tenant profile for search tenant ID, return empty array\r\n return [];\r\n }\r\n }\r\n const matchingTenantProfiles = [];\r\n searchTenantProfiles.forEach((tenantProfile) => {\r\n const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter);\r\n if (tenantedAccountInfo) {\r\n matchingTenantProfiles.push(tenantedAccountInfo);\r\n }\r\n });\r\n return matchingTenantProfiles;\r\n }\r\n tenantProfileMatchesFilter(tenantProfile, tenantProfileFilter) {\r\n if (!!tenantProfileFilter.localAccountId &&\r\n !this.matchLocalAccountIdFromTenantProfile(tenantProfile, tenantProfileFilter.localAccountId)) {\r\n return false;\r\n }\r\n if (!!tenantProfileFilter.name &&\r\n !(tenantProfile.name === tenantProfileFilter.name)) {\r\n return false;\r\n }\r\n if (tenantProfileFilter.isHomeTenant !== undefined &&\r\n !(tenantProfile.isHomeTenant === tenantProfileFilter.isHomeTenant)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter) {\r\n // Tenant Profile filtering\r\n if (tenantProfileFilter) {\r\n if (!!tenantProfileFilter.localAccountId &&\r\n !this.matchLocalAccountIdFromTokenClaims(idTokenClaims, tenantProfileFilter.localAccountId)) {\r\n return false;\r\n }\r\n if (!!tenantProfileFilter.loginHint &&\r\n !this.matchLoginHintFromTokenClaims(idTokenClaims, tenantProfileFilter.loginHint)) {\r\n return false;\r\n }\r\n if (!!tenantProfileFilter.username &&\r\n !this.matchUsername(idTokenClaims.preferred_username, tenantProfileFilter.username)) {\r\n return false;\r\n }\r\n if (!!tenantProfileFilter.name &&\r\n !this.matchName(idTokenClaims, tenantProfileFilter.name)) {\r\n return false;\r\n }\r\n if (!!tenantProfileFilter.sid &&\r\n !this.matchSid(idTokenClaims, tenantProfileFilter.sid)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * saves a cache record\r\n * @param cacheRecord {CacheRecord}\r\n * @param storeInCache {?StoreInCache}\r\n * @param correlationId {?string} correlation id\r\n */\r\n async saveCacheRecord(cacheRecord, correlationId, storeInCache) {\r\n if (!cacheRecord) {\r\n throw createClientAuthError(invalidCacheRecord);\r\n }\r\n try {\r\n if (!!cacheRecord.account) {\r\n await this.setAccount(cacheRecord.account, correlationId);\r\n }\r\n if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {\r\n await this.setIdTokenCredential(cacheRecord.idToken, correlationId);\r\n }\r\n if (!!cacheRecord.accessToken &&\r\n storeInCache?.accessToken !== false) {\r\n await this.saveAccessToken(cacheRecord.accessToken, correlationId);\r\n }\r\n if (!!cacheRecord.refreshToken &&\r\n storeInCache?.refreshToken !== false) {\r\n await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);\r\n }\r\n if (!!cacheRecord.appMetadata) {\r\n this.setAppMetadata(cacheRecord.appMetadata);\r\n }\r\n }\r\n catch (e) {\r\n this.commonLogger?.error(`CacheManager.saveCacheRecord: failed`);\r\n if (e instanceof Error) {\r\n this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`, correlationId);\r\n if (e.name === \"QuotaExceededError\" ||\r\n e.name === \"NS_ERROR_DOM_QUOTA_REACHED\" ||\r\n e.message.includes(\"exceeded the quota\")) {\r\n this.commonLogger?.error(`CacheManager.saveCacheRecord: exceeded storage quota`, correlationId);\r\n throw new CacheError(cacheQuotaExceededErrorCode);\r\n }\r\n else {\r\n throw new CacheError(e.name, e.message);\r\n }\r\n }\r\n else {\r\n this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`, correlationId);\r\n throw new CacheError(cacheUnknownErrorCode);\r\n }\r\n }\r\n }\r\n /**\r\n * saves access token credential\r\n * @param credential\r\n */\r\n async saveAccessToken(credential, correlationId) {\r\n const accessTokenFilter = {\r\n clientId: credential.clientId,\r\n credentialType: credential.credentialType,\r\n environment: credential.environment,\r\n homeAccountId: credential.homeAccountId,\r\n realm: credential.realm,\r\n tokenType: credential.tokenType,\r\n requestedClaimsHash: credential.requestedClaimsHash,\r\n };\r\n const tokenKeys = this.getTokenKeys();\r\n const currentScopes = ScopeSet.fromString(credential.target);\r\n const removedAccessTokens = [];\r\n tokenKeys.accessToken.forEach((key) => {\r\n if (!this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {\r\n return;\r\n }\r\n const tokenEntity = this.getAccessTokenCredential(key);\r\n if (tokenEntity &&\r\n this.credentialMatchesFilter(tokenEntity, accessTokenFilter)) {\r\n const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);\r\n if (tokenScopeSet.intersectingScopeSets(currentScopes)) {\r\n removedAccessTokens.push(this.removeAccessToken(key));\r\n }\r\n }\r\n });\r\n await Promise.all(removedAccessTokens);\r\n await this.setAccessTokenCredential(credential, correlationId);\r\n }\r\n /**\r\n * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache\r\n * Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\r\n * @param accountFilter - An object containing Account properties to filter by\r\n */\r\n getAccountsFilteredBy(accountFilter) {\r\n const allAccountKeys = this.getAccountKeys();\r\n const matchingAccounts = [];\r\n allAccountKeys.forEach((cacheKey) => {\r\n if (!this.isAccountKey(cacheKey, accountFilter.homeAccountId)) {\r\n // Don't parse value if the key doesn't match the account filters\r\n return;\r\n }\r\n const entity = this.getAccount(cacheKey, this.commonLogger);\r\n // Match base account fields\r\n if (!entity) {\r\n return;\r\n }\r\n if (!!accountFilter.homeAccountId &&\r\n !this.matchHomeAccountId(entity, accountFilter.homeAccountId)) {\r\n return;\r\n }\r\n if (!!accountFilter.username &&\r\n !this.matchUsername(entity.username, accountFilter.username)) {\r\n return;\r\n }\r\n if (!!accountFilter.environment &&\r\n !this.matchEnvironment(entity, accountFilter.environment)) {\r\n return;\r\n }\r\n if (!!accountFilter.realm &&\r\n !this.matchRealm(entity, accountFilter.realm)) {\r\n return;\r\n }\r\n if (!!accountFilter.nativeAccountId &&\r\n !this.matchNativeAccountId(entity, accountFilter.nativeAccountId)) {\r\n return;\r\n }\r\n if (!!accountFilter.authorityType &&\r\n !this.matchAuthorityType(entity, accountFilter.authorityType)) {\r\n return;\r\n }\r\n // If at least one tenant profile matches the tenant profile filter, add the account to the list of matching accounts\r\n const tenantProfileFilter = {\r\n localAccountId: accountFilter?.localAccountId,\r\n name: accountFilter?.name,\r\n };\r\n const matchingTenantProfiles = entity.tenantProfiles?.filter((tenantProfile) => {\r\n return this.tenantProfileMatchesFilter(tenantProfile, tenantProfileFilter);\r\n });\r\n if (matchingTenantProfiles && matchingTenantProfiles.length === 0) {\r\n // No tenant profile for this account matches filter, don't add to list of matching accounts\r\n return;\r\n }\r\n matchingAccounts.push(entity);\r\n });\r\n return matchingAccounts;\r\n }\r\n /**\r\n * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided\r\n * @param key\r\n * @param homeAccountId\r\n * @param tenantId\r\n * @returns\r\n */\r\n isAccountKey(key, homeAccountId, tenantId) {\r\n if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 3) {\r\n // Account cache keys contain 3 items separated by '-' (each item may also contain '-')\r\n return false;\r\n }\r\n if (homeAccountId &&\r\n !key.toLowerCase().includes(homeAccountId.toLowerCase())) {\r\n return false;\r\n }\r\n if (tenantId && !key.toLowerCase().includes(tenantId.toLowerCase())) {\r\n return false;\r\n }\r\n // Do not check environment as aliasing can cause false negatives\r\n return true;\r\n }\r\n /**\r\n * Returns true if the given key matches our credential key schema.\r\n * @param key\r\n */\r\n isCredentialKey(key) {\r\n if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 6) {\r\n // Credential cache keys contain 6 items separated by '-' (each item may also contain '-')\r\n return false;\r\n }\r\n const lowerCaseKey = key.toLowerCase();\r\n // Credential keys must indicate what credential type they represent\r\n if (lowerCaseKey.indexOf(CredentialType.ID_TOKEN.toLowerCase()) ===\r\n -1 &&\r\n lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) ===\r\n -1 &&\r\n lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) === -1 &&\r\n lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) ===\r\n -1) {\r\n return false;\r\n }\r\n if (lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) >\r\n -1) {\r\n // Refresh tokens must contain the client id or family id\r\n const clientIdValidation = `${CredentialType.REFRESH_TOKEN}${Separators.CACHE_KEY_SEPARATOR}${this.clientId}${Separators.CACHE_KEY_SEPARATOR}`;\r\n const familyIdValidation = `${CredentialType.REFRESH_TOKEN}${Separators.CACHE_KEY_SEPARATOR}${THE_FAMILY_ID}${Separators.CACHE_KEY_SEPARATOR}`;\r\n if (lowerCaseKey.indexOf(clientIdValidation.toLowerCase()) === -1 &&\r\n lowerCaseKey.indexOf(familyIdValidation.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n }\r\n else if (lowerCaseKey.indexOf(this.clientId.toLowerCase()) === -1) {\r\n // Tokens must contain the clientId\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Returns whether or not the given credential entity matches the filter\r\n * @param entity\r\n * @param filter\r\n * @returns\r\n */\r\n credentialMatchesFilter(entity, filter) {\r\n if (!!filter.clientId && !this.matchClientId(entity, filter.clientId)) {\r\n return false;\r\n }\r\n if (!!filter.userAssertionHash &&\r\n !this.matchUserAssertionHash(entity, filter.userAssertionHash)) {\r\n return false;\r\n }\r\n /*\r\n * homeAccountId can be undefined, and we want to filter out cached items that have a homeAccountId of \"\"\r\n * because we don't want a client_credential request to return a cached token that has a homeAccountId\r\n */\r\n if (typeof filter.homeAccountId === \"string\" &&\r\n !this.matchHomeAccountId(entity, filter.homeAccountId)) {\r\n return false;\r\n }\r\n if (!!filter.environment &&\r\n !this.matchEnvironment(entity, filter.environment)) {\r\n return false;\r\n }\r\n if (!!filter.realm && !this.matchRealm(entity, filter.realm)) {\r\n return false;\r\n }\r\n if (!!filter.credentialType &&\r\n !this.matchCredentialType(entity, filter.credentialType)) {\r\n return false;\r\n }\r\n if (!!filter.familyId && !this.matchFamilyId(entity, filter.familyId)) {\r\n return false;\r\n }\r\n /*\r\n * idTokens do not have \"target\", target specific refreshTokens do exist for some types of authentication\r\n * Resource specific refresh tokens case will be added when the support is deemed necessary\r\n */\r\n if (!!filter.target && !this.matchTarget(entity, filter.target)) {\r\n return false;\r\n }\r\n // If request OR cached entity has requested Claims Hash, check if they match\r\n if (filter.requestedClaimsHash || entity.requestedClaimsHash) {\r\n // Don't match if either is undefined or they are different\r\n if (entity.requestedClaimsHash !== filter.requestedClaimsHash) {\r\n return false;\r\n }\r\n }\r\n // Access Token with Auth Scheme specific matching\r\n if (entity.credentialType ===\r\n CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {\r\n if (!!filter.tokenType &&\r\n !this.matchTokenType(entity, filter.tokenType)) {\r\n return false;\r\n }\r\n // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key\r\n if (filter.tokenType === AuthenticationScheme.SSH) {\r\n if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata\r\n * @param filter\r\n */\r\n getAppMetadataFilteredBy(filter) {\r\n const allCacheKeys = this.getKeys();\r\n const matchingAppMetadata = {};\r\n allCacheKeys.forEach((cacheKey) => {\r\n // don't parse any non-appMetadata type cache entities\r\n if (!this.isAppMetadata(cacheKey)) {\r\n return;\r\n }\r\n // Attempt retrieval\r\n const entity = this.getAppMetadata(cacheKey);\r\n if (!entity) {\r\n return;\r\n }\r\n if (!!filter.environment &&\r\n !this.matchEnvironment(entity, filter.environment)) {\r\n return;\r\n }\r\n if (!!filter.clientId &&\r\n !this.matchClientId(entity, filter.clientId)) {\r\n return;\r\n }\r\n matchingAppMetadata[cacheKey] = entity;\r\n });\r\n return matchingAppMetadata;\r\n }\r\n /**\r\n * retrieve authorityMetadata that contains a matching alias\r\n * @param filter\r\n */\r\n getAuthorityMetadataByAlias(host) {\r\n const allCacheKeys = this.getAuthorityMetadataKeys();\r\n let matchedEntity = null;\r\n allCacheKeys.forEach((cacheKey) => {\r\n // don't parse any non-authorityMetadata type cache entities\r\n if (!this.isAuthorityMetadata(cacheKey) ||\r\n cacheKey.indexOf(this.clientId) === -1) {\r\n return;\r\n }\r\n // Attempt retrieval\r\n const entity = this.getAuthorityMetadata(cacheKey);\r\n if (!entity) {\r\n return;\r\n }\r\n if (entity.aliases.indexOf(host) === -1) {\r\n return;\r\n }\r\n matchedEntity = entity;\r\n });\r\n return matchedEntity;\r\n }\r\n /**\r\n * Removes all accounts and related tokens from cache.\r\n */\r\n async removeAllAccounts() {\r\n const allAccountKeys = this.getAccountKeys();\r\n const removedAccounts = [];\r\n allAccountKeys.forEach((cacheKey) => {\r\n removedAccounts.push(this.removeAccount(cacheKey));\r\n });\r\n await Promise.all(removedAccounts);\r\n }\r\n /**\r\n * Removes the account and related tokens for a given account key\r\n * @param account\r\n */\r\n async removeAccount(accountKey) {\r\n const account = this.getAccount(accountKey, this.commonLogger);\r\n if (!account) {\r\n return;\r\n }\r\n await this.removeAccountContext(account);\r\n this.removeItem(accountKey);\r\n }\r\n /**\r\n * Removes credentials associated with the provided account\r\n * @param account\r\n */\r\n async removeAccountContext(account) {\r\n const allTokenKeys = this.getTokenKeys();\r\n const accountId = account.generateAccountId();\r\n const removedCredentials = [];\r\n allTokenKeys.idToken.forEach((key) => {\r\n if (key.indexOf(accountId) === 0) {\r\n this.removeIdToken(key);\r\n }\r\n });\r\n allTokenKeys.accessToken.forEach((key) => {\r\n if (key.indexOf(accountId) === 0) {\r\n removedCredentials.push(this.removeAccessToken(key));\r\n }\r\n });\r\n allTokenKeys.refreshToken.forEach((key) => {\r\n if (key.indexOf(accountId) === 0) {\r\n this.removeRefreshToken(key);\r\n }\r\n });\r\n await Promise.all(removedCredentials);\r\n }\r\n /**\r\n * returns a boolean if the given credential is removed\r\n * @param credential\r\n */\r\n async removeAccessToken(key) {\r\n const credential = this.getAccessTokenCredential(key);\r\n if (!credential) {\r\n return;\r\n }\r\n // Remove Token Binding Key from key store for PoP Tokens Credentials\r\n if (credential.credentialType.toLowerCase() ===\r\n CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {\r\n if (credential.tokenType === AuthenticationScheme.POP) {\r\n const accessTokenWithAuthSchemeEntity = credential;\r\n const kid = accessTokenWithAuthSchemeEntity.keyId;\r\n if (kid) {\r\n try {\r\n await this.cryptoImpl.removeTokenBindingKey(kid);\r\n }\r\n catch (error) {\r\n throw createClientAuthError(bindingKeyNotRemoved);\r\n }\r\n }\r\n }\r\n }\r\n return this.removeItem(key);\r\n }\r\n /**\r\n * Removes all app metadata objects from cache.\r\n */\r\n removeAppMetadata() {\r\n const allCacheKeys = this.getKeys();\r\n allCacheKeys.forEach((cacheKey) => {\r\n if (this.isAppMetadata(cacheKey)) {\r\n this.removeItem(cacheKey);\r\n }\r\n });\r\n return true;\r\n }\r\n /**\r\n * Retrieve AccountEntity from cache\r\n * @param account\r\n */\r\n readAccountFromCache(account) {\r\n const accountKey = AccountEntity.generateAccountCacheKey(account);\r\n return this.getAccount(accountKey, this.commonLogger);\r\n }\r\n /**\r\n * Retrieve IdTokenEntity from cache\r\n * @param account {AccountInfo}\r\n * @param tokenKeys {?TokenKeys}\r\n * @param targetRealm {?string}\r\n * @param performanceClient {?IPerformanceClient}\r\n * @param correlationId {?string}\r\n */\r\n getIdToken(account, tokenKeys, targetRealm, performanceClient, correlationId) {\r\n this.commonLogger.trace(\"CacheManager - getIdToken called\");\r\n const idTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: CredentialType.ID_TOKEN,\r\n clientId: this.clientId,\r\n realm: targetRealm,\r\n };\r\n const idTokenMap = this.getIdTokensByFilter(idTokenFilter, tokenKeys);\r\n const numIdTokens = idTokenMap.size;\r\n if (numIdTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getIdToken - No token found\");\r\n return null;\r\n }\r\n else if (numIdTokens > 1) {\r\n let tokensToBeRemoved = idTokenMap;\r\n // Multiple tenant profiles and no tenant specified, pick home account\r\n if (!targetRealm) {\r\n const homeIdTokenMap = new Map();\r\n idTokenMap.forEach((idToken, key) => {\r\n if (idToken.realm === account.tenantId) {\r\n homeIdTokenMap.set(key, idToken);\r\n }\r\n });\r\n const numHomeIdTokens = homeIdTokenMap.size;\r\n if (numHomeIdTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result\");\r\n return idTokenMap.values().next().value;\r\n }\r\n else if (numHomeIdTokens === 1) {\r\n this.commonLogger.info(\"CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile\");\r\n return homeIdTokenMap.values().next().value;\r\n }\r\n else {\r\n // Multiple ID tokens for home tenant profile, remove all and return null\r\n tokensToBeRemoved = homeIdTokenMap;\r\n }\r\n }\r\n // Multiple tokens for a single tenant profile, remove all and return null\r\n this.commonLogger.info(\"CacheManager:getIdToken - Multiple matching ID tokens found, clearing them\");\r\n tokensToBeRemoved.forEach((idToken, key) => {\r\n this.removeIdToken(key);\r\n });\r\n if (performanceClient && correlationId) {\r\n performanceClient.addFields({ multiMatchedID: idTokenMap.size }, correlationId);\r\n }\r\n return null;\r\n }\r\n this.commonLogger.info(\"CacheManager:getIdToken - Returning ID token\");\r\n return idTokenMap.values().next().value;\r\n }\r\n /**\r\n * Gets all idTokens matching the given filter\r\n * @param filter\r\n * @returns\r\n */\r\n getIdTokensByFilter(filter, tokenKeys) {\r\n const idTokenKeys = (tokenKeys && tokenKeys.idToken) || this.getTokenKeys().idToken;\r\n const idTokens = new Map();\r\n idTokenKeys.forEach((key) => {\r\n if (!this.idTokenKeyMatchesFilter(key, {\r\n clientId: this.clientId,\r\n ...filter,\r\n })) {\r\n return;\r\n }\r\n const idToken = this.getIdTokenCredential(key);\r\n if (idToken && this.credentialMatchesFilter(idToken, filter)) {\r\n idTokens.set(key, idToken);\r\n }\r\n });\r\n return idTokens;\r\n }\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n * @returns\r\n */\r\n idTokenKeyMatchesFilter(inputKey, filter) {\r\n const key = inputKey.toLowerCase();\r\n if (filter.clientId &&\r\n key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId &&\r\n key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Removes idToken from the cache\r\n * @param key\r\n */\r\n removeIdToken(key) {\r\n this.removeItem(key);\r\n }\r\n /**\r\n * Removes refresh token from the cache\r\n * @param key\r\n */\r\n removeRefreshToken(key) {\r\n this.removeItem(key);\r\n }\r\n /**\r\n * Retrieve AccessTokenEntity from cache\r\n * @param account {AccountInfo}\r\n * @param request {BaseAuthRequest}\r\n * @param tokenKeys {?TokenKeys}\r\n * @param performanceClient {?IPerformanceClient}\r\n * @param correlationId {?string}\r\n */\r\n getAccessToken(account, request, tokenKeys, targetRealm, performanceClient, correlationId) {\r\n this.commonLogger.trace(\"CacheManager - getAccessToken called\");\r\n const scopes = ScopeSet.createSearchScopes(request.scopes);\r\n const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\r\n /*\r\n * Distinguish between Bearer and PoP/SSH token cache types\r\n * Cast to lowercase to handle \"bearer\" from ADFS\r\n */\r\n const credentialType = authScheme &&\r\n authScheme.toLowerCase() !==\r\n AuthenticationScheme.BEARER.toLowerCase()\r\n ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME\r\n : CredentialType.ACCESS_TOKEN;\r\n const accessTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: credentialType,\r\n clientId: this.clientId,\r\n realm: targetRealm || account.tenantId,\r\n target: scopes,\r\n tokenType: authScheme,\r\n keyId: request.sshKid,\r\n requestedClaimsHash: request.requestedClaimsHash,\r\n };\r\n const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||\r\n this.getTokenKeys().accessToken;\r\n const accessTokens = [];\r\n accessTokenKeys.forEach((key) => {\r\n // Validate key\r\n if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {\r\n const accessToken = this.getAccessTokenCredential(key);\r\n // Validate value\r\n if (accessToken &&\r\n this.credentialMatchesFilter(accessToken, accessTokenFilter)) {\r\n accessTokens.push(accessToken);\r\n }\r\n }\r\n });\r\n const numAccessTokens = accessTokens.length;\r\n if (numAccessTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getAccessToken - No token found\");\r\n return null;\r\n }\r\n else if (numAccessTokens > 1) {\r\n this.commonLogger.info(\"CacheManager:getAccessToken - Multiple access tokens found, clearing them\");\r\n accessTokens.forEach((accessToken) => {\r\n void this.removeAccessToken(generateCredentialKey(accessToken));\r\n });\r\n if (performanceClient && correlationId) {\r\n performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);\r\n }\r\n return null;\r\n }\r\n this.commonLogger.info(\"CacheManager:getAccessToken - Returning access token\");\r\n return accessTokens[0];\r\n }\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n * @param keyMustContainAllScopes\r\n * @returns\r\n */\r\n accessTokenKeyMatchesFilter(inputKey, filter, keyMustContainAllScopes) {\r\n const key = inputKey.toLowerCase();\r\n if (filter.clientId &&\r\n key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId &&\r\n key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.realm && key.indexOf(filter.realm.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.requestedClaimsHash &&\r\n key.indexOf(filter.requestedClaimsHash.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.target) {\r\n const scopes = filter.target.asArray();\r\n for (let i = 0; i < scopes.length; i++) {\r\n if (keyMustContainAllScopes &&\r\n !key.includes(scopes[i].toLowerCase())) {\r\n // When performing a cache lookup a missing scope would be a cache miss\r\n return false;\r\n }\r\n else if (!keyMustContainAllScopes &&\r\n key.includes(scopes[i].toLowerCase())) {\r\n // When performing a cache write, any token with a subset of requested scopes should be replaced\r\n return true;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * Gets all access tokens matching the filter\r\n * @param filter\r\n * @returns\r\n */\r\n getAccessTokensByFilter(filter) {\r\n const tokenKeys = this.getTokenKeys();\r\n const accessTokens = [];\r\n tokenKeys.accessToken.forEach((key) => {\r\n if (!this.accessTokenKeyMatchesFilter(key, filter, true)) {\r\n return;\r\n }\r\n const accessToken = this.getAccessTokenCredential(key);\r\n if (accessToken &&\r\n this.credentialMatchesFilter(accessToken, filter)) {\r\n accessTokens.push(accessToken);\r\n }\r\n });\r\n return accessTokens;\r\n }\r\n /**\r\n * Helper to retrieve the appropriate refresh token from cache\r\n * @param account {AccountInfo}\r\n * @param familyRT {boolean}\r\n * @param tokenKeys {?TokenKeys}\r\n * @param performanceClient {?IPerformanceClient}\r\n * @param correlationId {?string}\r\n */\r\n getRefreshToken(account, familyRT, tokenKeys, performanceClient, correlationId) {\r\n this.commonLogger.trace(\"CacheManager - getRefreshToken called\");\r\n const id = familyRT ? THE_FAMILY_ID : undefined;\r\n const refreshTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: CredentialType.REFRESH_TOKEN,\r\n clientId: this.clientId,\r\n familyId: id,\r\n };\r\n const refreshTokenKeys = (tokenKeys && tokenKeys.refreshToken) ||\r\n this.getTokenKeys().refreshToken;\r\n const refreshTokens = [];\r\n refreshTokenKeys.forEach((key) => {\r\n // Validate key\r\n if (this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {\r\n const refreshToken = this.getRefreshTokenCredential(key);\r\n // Validate value\r\n if (refreshToken &&\r\n this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {\r\n refreshTokens.push(refreshToken);\r\n }\r\n }\r\n });\r\n const numRefreshTokens = refreshTokens.length;\r\n if (numRefreshTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getRefreshToken - No refresh token found.\");\r\n return null;\r\n }\r\n // address the else case after remove functions address environment aliases\r\n if (numRefreshTokens > 1 && performanceClient && correlationId) {\r\n performanceClient.addFields({ multiMatchedRT: numRefreshTokens }, correlationId);\r\n }\r\n this.commonLogger.info(\"CacheManager:getRefreshToken - returning refresh token\");\r\n return refreshTokens[0];\r\n }\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n */\r\n refreshTokenKeyMatchesFilter(inputKey, filter) {\r\n const key = inputKey.toLowerCase();\r\n if (filter.familyId &&\r\n key.indexOf(filter.familyId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n // If familyId is used, clientId is not in the key\r\n if (!filter.familyId &&\r\n filter.clientId &&\r\n key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId &&\r\n key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Retrieve AppMetadataEntity from cache\r\n */\r\n readAppMetadataFromCache(environment) {\r\n const appMetadataFilter = {\r\n environment,\r\n clientId: this.clientId,\r\n };\r\n const appMetadata = this.getAppMetadataFilteredBy(appMetadataFilter);\r\n const appMetadataEntries = Object.keys(appMetadata).map((key) => appMetadata[key]);\r\n const numAppMetadata = appMetadataEntries.length;\r\n if (numAppMetadata < 1) {\r\n return null;\r\n }\r\n else if (numAppMetadata > 1) {\r\n throw createClientAuthError(multipleMatchingAppMetadata);\r\n }\r\n return appMetadataEntries[0];\r\n }\r\n /**\r\n * Return the family_id value associated with FOCI\r\n * @param environment\r\n * @param clientId\r\n */\r\n isAppMetadataFOCI(environment) {\r\n const appMetadata = this.readAppMetadataFromCache(environment);\r\n return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);\r\n }\r\n /**\r\n * helper to match account ids\r\n * @param value\r\n * @param homeAccountId\r\n */\r\n matchHomeAccountId(entity, homeAccountId) {\r\n return !!(typeof entity.homeAccountId === \"string\" &&\r\n homeAccountId === entity.homeAccountId);\r\n }\r\n /**\r\n * helper to match account ids\r\n * @param entity\r\n * @param localAccountId\r\n * @returns\r\n */\r\n matchLocalAccountIdFromTokenClaims(tokenClaims, localAccountId) {\r\n const idTokenLocalAccountId = tokenClaims.oid || tokenClaims.sub;\r\n return localAccountId === idTokenLocalAccountId;\r\n }\r\n matchLocalAccountIdFromTenantProfile(tenantProfile, localAccountId) {\r\n return tenantProfile.localAccountId === localAccountId;\r\n }\r\n /**\r\n * helper to match names\r\n * @param entity\r\n * @param name\r\n * @returns true if the downcased name properties are present and match in the filter and the entity\r\n */\r\n matchName(claims, name) {\r\n return !!(name.toLowerCase() === claims.name?.toLowerCase());\r\n }\r\n /**\r\n * helper to match usernames\r\n * @param entity\r\n * @param username\r\n * @returns\r\n */\r\n matchUsername(cachedUsername, filterUsername) {\r\n return !!(cachedUsername &&\r\n typeof cachedUsername === \"string\" &&\r\n filterUsername?.toLowerCase() === cachedUsername.toLowerCase());\r\n }\r\n /**\r\n * helper to match assertion\r\n * @param value\r\n * @param oboAssertion\r\n */\r\n matchUserAssertionHash(entity, userAssertionHash) {\r\n return !!(entity.userAssertionHash &&\r\n userAssertionHash === entity.userAssertionHash);\r\n }\r\n /**\r\n * helper to match environment\r\n * @param value\r\n * @param environment\r\n */\r\n matchEnvironment(entity, environment) {\r\n // Check static authority options first for cases where authority metadata has not been resolved and cached yet\r\n if (this.staticAuthorityOptions) {\r\n const staticAliases = getAliasesFromStaticSources(this.staticAuthorityOptions, this.commonLogger);\r\n if (staticAliases.includes(environment) &&\r\n staticAliases.includes(entity.environment)) {\r\n return true;\r\n }\r\n }\r\n // Query metadata cache if no static authority configuration has aliases that match enviroment\r\n const cloudMetadata = this.getAuthorityMetadataByAlias(environment);\r\n if (cloudMetadata &&\r\n cloudMetadata.aliases.indexOf(entity.environment) > -1) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * helper to match credential type\r\n * @param entity\r\n * @param credentialType\r\n */\r\n matchCredentialType(entity, credentialType) {\r\n return (entity.credentialType &&\r\n credentialType.toLowerCase() === entity.credentialType.toLowerCase());\r\n }\r\n /**\r\n * helper to match client ids\r\n * @param entity\r\n * @param clientId\r\n */\r\n matchClientId(entity, clientId) {\r\n return !!(entity.clientId && clientId === entity.clientId);\r\n }\r\n /**\r\n * helper to match family ids\r\n * @param entity\r\n * @param familyId\r\n */\r\n matchFamilyId(entity, familyId) {\r\n return !!(entity.familyId && familyId === entity.familyId);\r\n }\r\n /**\r\n * helper to match realm\r\n * @param entity\r\n * @param realm\r\n */\r\n matchRealm(entity, realm) {\r\n return !!(entity.realm?.toLowerCase() === realm.toLowerCase());\r\n }\r\n /**\r\n * helper to match nativeAccountId\r\n * @param entity\r\n * @param nativeAccountId\r\n * @returns boolean indicating the match result\r\n */\r\n matchNativeAccountId(entity, nativeAccountId) {\r\n return !!(entity.nativeAccountId && nativeAccountId === entity.nativeAccountId);\r\n }\r\n /**\r\n * helper to match loginHint which can be either:\r\n * 1. login_hint ID token claim\r\n * 2. username in cached account object\r\n * 3. upn in ID token claims\r\n * @param entity\r\n * @param loginHint\r\n * @returns\r\n */\r\n matchLoginHintFromTokenClaims(tokenClaims, loginHint) {\r\n if (tokenClaims.login_hint === loginHint) {\r\n return true;\r\n }\r\n if (tokenClaims.preferred_username === loginHint) {\r\n return true;\r\n }\r\n if (tokenClaims.upn === loginHint) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Helper to match sid\r\n * @param entity\r\n * @param sid\r\n * @returns true if the sid claim is present and matches the filter\r\n */\r\n matchSid(idTokenClaims, sid) {\r\n return idTokenClaims.sid === sid;\r\n }\r\n matchAuthorityType(entity, authorityType) {\r\n return !!(entity.authorityType &&\r\n authorityType.toLowerCase() === entity.authorityType.toLowerCase());\r\n }\r\n /**\r\n * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.\r\n * @param entity\r\n * @param target\r\n */\r\n matchTarget(entity, target) {\r\n const isNotAccessTokenCredential = entity.credentialType !== CredentialType.ACCESS_TOKEN &&\r\n entity.credentialType !==\r\n CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\r\n if (isNotAccessTokenCredential || !entity.target) {\r\n return false;\r\n }\r\n const entityScopeSet = ScopeSet.fromString(entity.target);\r\n return entityScopeSet.containsScopeSet(target);\r\n }\r\n /**\r\n * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise\r\n * @param entity\r\n * @param tokenType\r\n */\r\n matchTokenType(entity, tokenType) {\r\n return !!(entity.tokenType && entity.tokenType === tokenType);\r\n }\r\n /**\r\n * Returns true if the credential's keyId matches the one in the request, false otherwise\r\n * @param entity\r\n * @param keyId\r\n */\r\n matchKeyId(entity, keyId) {\r\n return !!(entity.keyId && entity.keyId === keyId);\r\n }\r\n /**\r\n * returns if a given cache entity is of the type appmetadata\r\n * @param key\r\n */\r\n isAppMetadata(key) {\r\n return key.indexOf(APP_METADATA) !== -1;\r\n }\r\n /**\r\n * returns if a given cache entity is of the type authoritymetadata\r\n * @param key\r\n */\r\n isAuthorityMetadata(key) {\r\n return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;\r\n }\r\n /**\r\n * returns cache key used for cloud instance metadata\r\n */\r\n generateAuthorityMetadataCacheKey(authority) {\r\n return `${AUTHORITY_METADATA_CONSTANTS.CACHE_KEY}-${this.clientId}-${authority}`;\r\n }\r\n /**\r\n * Helper to convert serialized data to object\r\n * @param obj\r\n * @param json\r\n */\r\n static toObject(obj, json) {\r\n for (const propertyName in json) {\r\n obj[propertyName] = json[propertyName];\r\n }\r\n return obj;\r\n }\r\n}\r\n/** @internal */\r\nclass DefaultStorageClass extends CacheManager {\r\n async setAccount() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAccount() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n async setIdTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getIdTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n async setAccessTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAccessTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n async setRefreshTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getRefreshTokenCredential() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n setAppMetadata() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAppMetadata() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n setServerTelemetry() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getServerTelemetry() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n setAuthorityMetadata() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAuthorityMetadata() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAuthorityMetadataKeys() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n setThrottlingCache() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getThrottlingCache() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n removeItem() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getKeys() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getAccountKeys() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n getTokenKeys() {\r\n throw createClientAuthError(methodNotImplemented);\r\n }\r\n}\n\nexport { CacheManager, DefaultStorageClass };\n//# sourceMappingURL=CacheManager.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { DEFAULT_CRYPTO_IMPLEMENTATION } from '../crypto/ICrypto.mjs';\nimport { Logger, LogLevel } from '../logger/Logger.mjs';\nimport { DEFAULT_TOKEN_RENEWAL_OFFSET_SEC, Constants } from '../utils/Constants.mjs';\nimport { version } from '../packageMetadata.mjs';\nimport { AzureCloudInstance } from '../authority/AuthorityOptions.mjs';\nimport { DefaultStorageClass } from '../cache/CacheManager.mjs';\nimport { ProtocolMode } from '../authority/ProtocolMode.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst DEFAULT_SYSTEM_OPTIONS = {\r\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\r\n preventCorsPreflight: false,\r\n};\r\nconst DEFAULT_LOGGER_IMPLEMENTATION = {\r\n loggerCallback: () => {\r\n // allow users to not set loggerCallback\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n correlationId: Constants.EMPTY_STRING,\r\n};\r\nconst DEFAULT_CACHE_OPTIONS = {\r\n claimsBasedCachingEnabled: false,\r\n};\r\nconst DEFAULT_NETWORK_IMPLEMENTATION = {\r\n async sendGetRequestAsync() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n async sendPostRequestAsync() {\r\n throw createClientAuthError(methodNotImplemented);\r\n },\r\n};\r\nconst DEFAULT_LIBRARY_INFO = {\r\n sku: Constants.SKU,\r\n version: version,\r\n cpu: Constants.EMPTY_STRING,\r\n os: Constants.EMPTY_STRING,\r\n};\r\nconst DEFAULT_CLIENT_CREDENTIALS = {\r\n clientSecret: Constants.EMPTY_STRING,\r\n clientAssertion: undefined,\r\n};\r\nconst DEFAULT_AZURE_CLOUD_OPTIONS = {\r\n azureCloudInstance: AzureCloudInstance.None,\r\n tenant: `${Constants.DEFAULT_COMMON_TENANT}`,\r\n};\r\nconst DEFAULT_TELEMETRY_OPTIONS = {\r\n application: {\r\n appName: \"\",\r\n appVersion: \"\",\r\n },\r\n};\r\n/**\r\n * Function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param Configuration\r\n *\r\n * @returns Configuration\r\n */\r\nfunction buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, cacheOptions: userCacheOptions, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {\r\n const loggerOptions = {\r\n ...DEFAULT_LOGGER_IMPLEMENTATION,\r\n ...userLoggerOption,\r\n };\r\n return {\r\n authOptions: buildAuthOptions(userAuthOptions),\r\n systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },\r\n loggerOptions: loggerOptions,\r\n cacheOptions: { ...DEFAULT_CACHE_OPTIONS, ...userCacheOptions },\r\n storageInterface: storageImplementation ||\r\n new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),\r\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\r\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\r\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\r\n libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },\r\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },\r\n serverTelemetryManager: serverTelemetryManager || null,\r\n persistencePlugin: persistencePlugin || null,\r\n serializableCache: serializableCache || null,\r\n };\r\n}\r\n/**\r\n * Construct authoptions from the client and platform passed values\r\n * @param authOptions\r\n */\r\nfunction buildAuthOptions(authOptions) {\r\n return {\r\n clientCapabilities: [],\r\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\r\n skipAuthorityMetadataCache: false,\r\n instanceAware: false,\r\n ...authOptions,\r\n };\r\n}\r\n/**\r\n * Returns true if config has protocolMode set to ProtocolMode.OIDC, false otherwise\r\n * @param ClientConfiguration\r\n */\r\nfunction isOidcProtocolMode(config) {\r\n return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);\r\n}\n\nexport { DEFAULT_SYSTEM_OPTIONS, buildClientConfiguration, isOidcProtocolMode };\n//# sourceMappingURL=ClientConfiguration.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst CcsCredentialType = {\r\n HOME_ACCOUNT_ID: \"home_account_id\",\r\n UPN: \"UPN\",\r\n};\n\nexport { CcsCredentialType };\n//# sourceMappingURL=CcsCredential.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst CLIENT_ID = \"client_id\";\r\nconst REDIRECT_URI = \"redirect_uri\";\r\nconst RESPONSE_TYPE = \"response_type\";\r\nconst RESPONSE_MODE = \"response_mode\";\r\nconst GRANT_TYPE = \"grant_type\";\r\nconst CLAIMS = \"claims\";\r\nconst SCOPE = \"scope\";\r\nconst ERROR = \"error\";\r\nconst ERROR_DESCRIPTION = \"error_description\";\r\nconst ACCESS_TOKEN = \"access_token\";\r\nconst ID_TOKEN = \"id_token\";\r\nconst REFRESH_TOKEN = \"refresh_token\";\r\nconst EXPIRES_IN = \"expires_in\";\r\nconst REFRESH_TOKEN_EXPIRES_IN = \"refresh_token_expires_in\";\r\nconst STATE = \"state\";\r\nconst NONCE = \"nonce\";\r\nconst PROMPT = \"prompt\";\r\nconst SESSION_STATE = \"session_state\";\r\nconst CLIENT_INFO = \"client_info\";\r\nconst CODE = \"code\";\r\nconst CODE_CHALLENGE = \"code_challenge\";\r\nconst CODE_CHALLENGE_METHOD = \"code_challenge_method\";\r\nconst CODE_VERIFIER = \"code_verifier\";\r\nconst CLIENT_REQUEST_ID = \"client-request-id\";\r\nconst X_CLIENT_SKU = \"x-client-SKU\";\r\nconst X_CLIENT_VER = \"x-client-VER\";\r\nconst X_CLIENT_OS = \"x-client-OS\";\r\nconst X_CLIENT_CPU = \"x-client-CPU\";\r\nconst X_CLIENT_CURR_TELEM = \"x-client-current-telemetry\";\r\nconst X_CLIENT_LAST_TELEM = \"x-client-last-telemetry\";\r\nconst X_MS_LIB_CAPABILITY = \"x-ms-lib-capability\";\r\nconst X_APP_NAME = \"x-app-name\";\r\nconst X_APP_VER = \"x-app-ver\";\r\nconst POST_LOGOUT_URI = \"post_logout_redirect_uri\";\r\nconst ID_TOKEN_HINT = \"id_token_hint\";\r\nconst DEVICE_CODE = \"device_code\";\r\nconst CLIENT_SECRET = \"client_secret\";\r\nconst CLIENT_ASSERTION = \"client_assertion\";\r\nconst CLIENT_ASSERTION_TYPE = \"client_assertion_type\";\r\nconst TOKEN_TYPE = \"token_type\";\r\nconst REQ_CNF = \"req_cnf\";\r\nconst OBO_ASSERTION = \"assertion\";\r\nconst REQUESTED_TOKEN_USE = \"requested_token_use\";\r\nconst ON_BEHALF_OF = \"on_behalf_of\";\r\nconst FOCI = \"foci\";\r\nconst CCS_HEADER = \"X-AnchorMailbox\";\r\nconst RETURN_SPA_CODE = \"return_spa_code\";\r\nconst NATIVE_BROKER = \"nativebroker\";\r\nconst LOGOUT_HINT = \"logout_hint\";\r\nconst SID = \"sid\";\r\nconst LOGIN_HINT = \"login_hint\";\r\nconst DOMAIN_HINT = \"domain_hint\";\r\nconst X_CLIENT_EXTRA_SKU = \"x-client-xtra-sku\";\r\nconst BROKER_CLIENT_ID = \"brk_client_id\";\r\nconst BROKER_REDIRECT_URI = \"brk_redirect_uri\";\r\nconst INSTANCE_AWARE = \"instance_aware\";\n\nexport { ACCESS_TOKEN, BROKER_CLIENT_ID, BROKER_REDIRECT_URI, CCS_HEADER, CLAIMS, CLIENT_ASSERTION, CLIENT_ASSERTION_TYPE, CLIENT_ID, CLIENT_INFO, CLIENT_REQUEST_ID, CLIENT_SECRET, CODE, CODE_CHALLENGE, CODE_CHALLENGE_METHOD, CODE_VERIFIER, DEVICE_CODE, DOMAIN_HINT, ERROR, ERROR_DESCRIPTION, EXPIRES_IN, FOCI, GRANT_TYPE, ID_TOKEN, ID_TOKEN_HINT, INSTANCE_AWARE, LOGIN_HINT, LOGOUT_HINT, NATIVE_BROKER, NONCE, OBO_ASSERTION, ON_BEHALF_OF, POST_LOGOUT_URI, PROMPT, REDIRECT_URI, REFRESH_TOKEN, REFRESH_TOKEN_EXPIRES_IN, REQUESTED_TOKEN_USE, REQ_CNF, RESPONSE_MODE, RESPONSE_TYPE, RETURN_SPA_CODE, SCOPE, SESSION_STATE, SID, STATE, TOKEN_TYPE, X_APP_NAME, X_APP_VER, X_CLIENT_CPU, X_CLIENT_CURR_TELEM, X_CLIENT_EXTRA_SKU, X_CLIENT_LAST_TELEM, X_CLIENT_OS, X_CLIENT_SKU, X_CLIENT_VER, X_MS_LIB_CAPABILITY };\n//# sourceMappingURL=AADServerParamKeys.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants, ResponseMode, OIDC_DEFAULT_SCOPES, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.mjs';\nimport { CLIENT_ID, BROKER_CLIENT_ID, REDIRECT_URI, RESPONSE_TYPE, RESPONSE_MODE, NATIVE_BROKER, SCOPE, POST_LOGOUT_URI, ID_TOKEN_HINT, DOMAIN_HINT, LOGIN_HINT, SID, CLAIMS, CLIENT_REQUEST_ID, X_CLIENT_SKU, X_CLIENT_VER, X_CLIENT_OS, X_CLIENT_CPU, X_APP_NAME, X_APP_VER, PROMPT, STATE, NONCE, CODE_CHALLENGE, CODE_CHALLENGE_METHOD, CODE, DEVICE_CODE, REFRESH_TOKEN, CODE_VERIFIER, CLIENT_SECRET, CLIENT_ASSERTION, CLIENT_ASSERTION_TYPE, OBO_ASSERTION, REQUESTED_TOKEN_USE, GRANT_TYPE, INSTANCE_AWARE, TOKEN_TYPE, REQ_CNF, X_CLIENT_CURR_TELEM, X_CLIENT_LAST_TELEM, X_MS_LIB_CAPABILITY, LOGOUT_HINT, BROKER_REDIRECT_URI } from '../constants/AADServerParamKeys.mjs';\nimport { ScopeSet } from './ScopeSet.mjs';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { invalidClaims, pkceParamsMissing } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction instrumentBrokerParams(parameters, correlationId, performanceClient) {\r\n if (!correlationId) {\r\n return;\r\n }\r\n const clientId = parameters.get(CLIENT_ID);\r\n if (clientId && parameters.has(BROKER_CLIENT_ID)) {\r\n performanceClient?.addFields({\r\n embeddedClientId: clientId,\r\n embeddedRedirectUri: parameters.get(REDIRECT_URI),\r\n }, correlationId);\r\n }\r\n}\r\n/**\r\n * add response_type = code\r\n */\r\nfunction addResponseTypeCode(parameters) {\r\n parameters.set(RESPONSE_TYPE, Constants.CODE_RESPONSE_TYPE);\r\n}\r\n/**\r\n * add response_type = token id_token\r\n */\r\nfunction addResponseTypeForTokenAndIdToken(parameters) {\r\n parameters.set(RESPONSE_TYPE, `${Constants.TOKEN_RESPONSE_TYPE} ${Constants.ID_TOKEN_RESPONSE_TYPE}`);\r\n}\r\n/**\r\n * add response_mode. defaults to query.\r\n * @param responseMode\r\n */\r\nfunction addResponseMode(parameters, responseMode) {\r\n parameters.set(RESPONSE_MODE, responseMode ? responseMode : ResponseMode.QUERY);\r\n}\r\n/**\r\n * Add flag to indicate STS should attempt to use WAM if available\r\n */\r\nfunction addNativeBroker(parameters) {\r\n parameters.set(NATIVE_BROKER, \"1\");\r\n}\r\n/**\r\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\r\n * @param scopeSet\r\n * @param addOidcScopes\r\n */\r\nfunction addScopes(parameters, scopes, addOidcScopes = true, defaultScopes = OIDC_DEFAULT_SCOPES) {\r\n // Always add openid to the scopes when adding OIDC scopes\r\n if (addOidcScopes &&\r\n !defaultScopes.includes(\"openid\") &&\r\n !scopes.includes(\"openid\")) {\r\n defaultScopes.push(\"openid\");\r\n }\r\n const requestScopes = addOidcScopes\r\n ? [...(scopes || []), ...defaultScopes]\r\n : scopes || [];\r\n const scopeSet = new ScopeSet(requestScopes);\r\n parameters.set(SCOPE, scopeSet.printScopes());\r\n}\r\n/**\r\n * add clientId\r\n * @param clientId\r\n */\r\nfunction addClientId(parameters, clientId) {\r\n parameters.set(CLIENT_ID, clientId);\r\n}\r\n/**\r\n * add redirect_uri\r\n * @param redirectUri\r\n */\r\nfunction addRedirectUri(parameters, redirectUri) {\r\n parameters.set(REDIRECT_URI, redirectUri);\r\n}\r\n/**\r\n * add post logout redirectUri\r\n * @param redirectUri\r\n */\r\nfunction addPostLogoutRedirectUri(parameters, redirectUri) {\r\n parameters.set(POST_LOGOUT_URI, redirectUri);\r\n}\r\n/**\r\n * add id_token_hint to logout request\r\n * @param idTokenHint\r\n */\r\nfunction addIdTokenHint(parameters, idTokenHint) {\r\n parameters.set(ID_TOKEN_HINT, idTokenHint);\r\n}\r\n/**\r\n * add domain_hint\r\n * @param domainHint\r\n */\r\nfunction addDomainHint(parameters, domainHint) {\r\n parameters.set(DOMAIN_HINT, domainHint);\r\n}\r\n/**\r\n * add login_hint\r\n * @param loginHint\r\n */\r\nfunction addLoginHint(parameters, loginHint) {\r\n parameters.set(LOGIN_HINT, loginHint);\r\n}\r\n/**\r\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\r\n * @param loginHint\r\n */\r\nfunction addCcsUpn(parameters, loginHint) {\r\n parameters.set(HeaderNames.CCS_HEADER, `UPN:${loginHint}`);\r\n}\r\n/**\r\n * Adds the CCS (Cache Credential Service) query parameter for account object\r\n * @param loginHint\r\n */\r\nfunction addCcsOid(parameters, clientInfo) {\r\n parameters.set(HeaderNames.CCS_HEADER, `Oid:${clientInfo.uid}@${clientInfo.utid}`);\r\n}\r\n/**\r\n * add sid\r\n * @param sid\r\n */\r\nfunction addSid(parameters, sid) {\r\n parameters.set(SID, sid);\r\n}\r\n/**\r\n * add claims\r\n * @param claims\r\n */\r\nfunction addClaims(parameters, claims, clientCapabilities) {\r\n const mergedClaims = addClientCapabilitiesToClaims(claims, clientCapabilities);\r\n try {\r\n JSON.parse(mergedClaims);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidClaims);\r\n }\r\n parameters.set(CLAIMS, mergedClaims);\r\n}\r\n/**\r\n * add correlationId\r\n * @param correlationId\r\n */\r\nfunction addCorrelationId(parameters, correlationId) {\r\n parameters.set(CLIENT_REQUEST_ID, correlationId);\r\n}\r\n/**\r\n * add library info query params\r\n * @param libraryInfo\r\n */\r\nfunction addLibraryInfo(parameters, libraryInfo) {\r\n // Telemetry Info\r\n parameters.set(X_CLIENT_SKU, libraryInfo.sku);\r\n parameters.set(X_CLIENT_VER, libraryInfo.version);\r\n if (libraryInfo.os) {\r\n parameters.set(X_CLIENT_OS, libraryInfo.os);\r\n }\r\n if (libraryInfo.cpu) {\r\n parameters.set(X_CLIENT_CPU, libraryInfo.cpu);\r\n }\r\n}\r\n/**\r\n * Add client telemetry parameters\r\n * @param appTelemetry\r\n */\r\nfunction addApplicationTelemetry(parameters, appTelemetry) {\r\n if (appTelemetry?.appName) {\r\n parameters.set(X_APP_NAME, appTelemetry.appName);\r\n }\r\n if (appTelemetry?.appVersion) {\r\n parameters.set(X_APP_VER, appTelemetry.appVersion);\r\n }\r\n}\r\n/**\r\n * add prompt\r\n * @param prompt\r\n */\r\nfunction addPrompt(parameters, prompt) {\r\n parameters.set(PROMPT, prompt);\r\n}\r\n/**\r\n * add state\r\n * @param state\r\n */\r\nfunction addState(parameters, state) {\r\n if (state) {\r\n parameters.set(STATE, state);\r\n }\r\n}\r\n/**\r\n * add nonce\r\n * @param nonce\r\n */\r\nfunction addNonce(parameters, nonce) {\r\n parameters.set(NONCE, nonce);\r\n}\r\n/**\r\n * add code_challenge and code_challenge_method\r\n * - throw if either of them are not passed\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\nfunction addCodeChallengeParams(parameters, codeChallenge, codeChallengeMethod) {\r\n if (codeChallenge && codeChallengeMethod) {\r\n parameters.set(CODE_CHALLENGE, codeChallenge);\r\n parameters.set(CODE_CHALLENGE_METHOD, codeChallengeMethod);\r\n }\r\n else {\r\n throw createClientConfigurationError(pkceParamsMissing);\r\n }\r\n}\r\n/**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\nfunction addAuthorizationCode(parameters, code) {\r\n parameters.set(CODE, code);\r\n}\r\n/**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\nfunction addDeviceCode(parameters, code) {\r\n parameters.set(DEVICE_CODE, code);\r\n}\r\n/**\r\n * add the `refreshToken` passed by the user\r\n * @param refreshToken\r\n */\r\nfunction addRefreshToken(parameters, refreshToken) {\r\n parameters.set(REFRESH_TOKEN, refreshToken);\r\n}\r\n/**\r\n * add the `code_verifier` passed by the user to exchange for a token\r\n * @param codeVerifier\r\n */\r\nfunction addCodeVerifier(parameters, codeVerifier) {\r\n parameters.set(CODE_VERIFIER, codeVerifier);\r\n}\r\n/**\r\n * add client_secret\r\n * @param clientSecret\r\n */\r\nfunction addClientSecret(parameters, clientSecret) {\r\n parameters.set(CLIENT_SECRET, clientSecret);\r\n}\r\n/**\r\n * add clientAssertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\nfunction addClientAssertion(parameters, clientAssertion) {\r\n if (clientAssertion) {\r\n parameters.set(CLIENT_ASSERTION, clientAssertion);\r\n }\r\n}\r\n/**\r\n * add clientAssertionType for confidential client flows\r\n * @param clientAssertionType\r\n */\r\nfunction addClientAssertionType(parameters, clientAssertionType) {\r\n if (clientAssertionType) {\r\n parameters.set(CLIENT_ASSERTION_TYPE, clientAssertionType);\r\n }\r\n}\r\n/**\r\n * add OBO assertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\nfunction addOboAssertion(parameters, oboAssertion) {\r\n parameters.set(OBO_ASSERTION, oboAssertion);\r\n}\r\n/**\r\n * add grant type\r\n * @param grantType\r\n */\r\nfunction addRequestTokenUse(parameters, tokenUse) {\r\n parameters.set(REQUESTED_TOKEN_USE, tokenUse);\r\n}\r\n/**\r\n * add grant type\r\n * @param grantType\r\n */\r\nfunction addGrantType(parameters, grantType) {\r\n parameters.set(GRANT_TYPE, grantType);\r\n}\r\n/**\r\n * add client info\r\n *\r\n */\r\nfunction addClientInfo(parameters) {\r\n parameters.set(CLIENT_INFO, \"1\");\r\n}\r\nfunction addInstanceAware(parameters) {\r\n if (!parameters.has(INSTANCE_AWARE)) {\r\n parameters.set(INSTANCE_AWARE, \"true\");\r\n }\r\n}\r\n/**\r\n * add extraQueryParams\r\n * @param eQParams\r\n */\r\nfunction addExtraQueryParameters(parameters, eQParams) {\r\n Object.entries(eQParams).forEach(([key, value]) => {\r\n if (!parameters.has(key) && value) {\r\n parameters.set(key, value);\r\n }\r\n });\r\n}\r\nfunction addClientCapabilitiesToClaims(claims, clientCapabilities) {\r\n let mergedClaims;\r\n // Parse provided claims into JSON object or initialize empty object\r\n if (!claims) {\r\n mergedClaims = {};\r\n }\r\n else {\r\n try {\r\n mergedClaims = JSON.parse(claims);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidClaims);\r\n }\r\n }\r\n if (clientCapabilities && clientCapabilities.length > 0) {\r\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {\r\n // Add access_token key to claims object\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\r\n }\r\n // Add xms_cc claim with provided clientCapabilities to access_token key\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] =\r\n {\r\n values: clientCapabilities,\r\n };\r\n }\r\n return JSON.stringify(mergedClaims);\r\n}\r\n/**\r\n * adds `username` for Password Grant flow\r\n * @param username\r\n */\r\nfunction addUsername(parameters, username) {\r\n parameters.set(PasswordGrantConstants.username, username);\r\n}\r\n/**\r\n * adds `password` for Password Grant flow\r\n * @param password\r\n */\r\nfunction addPassword(parameters, password) {\r\n parameters.set(PasswordGrantConstants.password, password);\r\n}\r\n/**\r\n * add pop_jwk to query params\r\n * @param cnfString\r\n */\r\nfunction addPopToken(parameters, cnfString) {\r\n if (cnfString) {\r\n parameters.set(TOKEN_TYPE, AuthenticationScheme.POP);\r\n parameters.set(REQ_CNF, cnfString);\r\n }\r\n}\r\n/**\r\n * add SSH JWK and key ID to query params\r\n */\r\nfunction addSshJwk(parameters, sshJwkString) {\r\n if (sshJwkString) {\r\n parameters.set(TOKEN_TYPE, AuthenticationScheme.SSH);\r\n parameters.set(REQ_CNF, sshJwkString);\r\n }\r\n}\r\n/**\r\n * add server telemetry fields\r\n * @param serverTelemetryManager\r\n */\r\nfunction addServerTelemetry(parameters, serverTelemetryManager) {\r\n parameters.set(X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\r\n parameters.set(X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\r\n}\r\n/**\r\n * Adds parameter that indicates to the server that throttling is supported\r\n */\r\nfunction addThrottling(parameters) {\r\n parameters.set(X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\r\n}\r\n/**\r\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\r\n */\r\nfunction addLogoutHint(parameters, logoutHint) {\r\n parameters.set(LOGOUT_HINT, logoutHint);\r\n}\r\nfunction addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {\r\n if (!parameters.has(BROKER_CLIENT_ID)) {\r\n parameters.set(BROKER_CLIENT_ID, brokerClientId);\r\n }\r\n if (!parameters.has(BROKER_REDIRECT_URI)) {\r\n parameters.set(BROKER_REDIRECT_URI, brokerRedirectUri);\r\n }\r\n}\n\nexport { addApplicationTelemetry, addAuthorizationCode, addBrokerParameters, addCcsOid, addCcsUpn, addClaims, addClientAssertion, addClientAssertionType, addClientCapabilitiesToClaims, addClientId, addClientInfo, addClientSecret, addCodeChallengeParams, addCodeVerifier, addCorrelationId, addDeviceCode, addDomainHint, addExtraQueryParameters, addGrantType, addIdTokenHint, addInstanceAware, addLibraryInfo, addLoginHint, addLogoutHint, addNativeBroker, addNonce, addOboAssertion, addPassword, addPopToken, addPostLogoutRedirectUri, addPrompt, addRedirectUri, addRefreshToken, addRequestTokenUse, addResponseMode, addResponseTypeCode, addResponseTypeForTokenAndIdToken, addScopes, addServerTelemetry, addSid, addSshJwk, addState, addThrottling, addUsername, instrumentBrokerParams };\n//# sourceMappingURL=RequestParameterBuilder.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isOpenIdConfigResponse(response) {\r\n return (response.hasOwnProperty(\"authorization_endpoint\") &&\r\n response.hasOwnProperty(\"token_endpoint\") &&\r\n response.hasOwnProperty(\"issuer\") &&\r\n response.hasOwnProperty(\"jwks_uri\"));\r\n}\n\nexport { isOpenIdConfigResponse };\n//# sourceMappingURL=OpenIdConfigResponse.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryResponse(response) {\r\n return (response.hasOwnProperty(\"tenant_discovery_endpoint\") &&\r\n response.hasOwnProperty(\"metadata\"));\r\n}\n\nexport { isCloudInstanceDiscoveryResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryResponse.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryErrorResponse(response) {\r\n return (response.hasOwnProperty(\"error\") &&\r\n response.hasOwnProperty(\"error_description\"));\r\n}\n\nexport { isCloudInstanceDiscoveryErrorResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryErrorResponse.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nconst PerformanceEvents = {\r\n /**\r\n * acquireTokenByCode API (msal-browser and msal-node).\r\n * Used to acquire tokens by trading an authorization code against the token endpoint.\r\n */\r\n AcquireTokenByCode: \"acquireTokenByCode\",\r\n /**\r\n * acquireTokenByRefreshToken API (msal-browser and msal-node).\r\n * Used to renew an access token using a refresh token against the token endpoint.\r\n */\r\n AcquireTokenByRefreshToken: \"acquireTokenByRefreshToken\",\r\n /**\r\n * acquireTokenSilent API (msal-browser and msal-node).\r\n * Used to silently acquire a new access token (from the cache or the network).\r\n */\r\n AcquireTokenSilent: \"acquireTokenSilent\",\r\n /**\r\n * acquireTokenSilentAsync (msal-browser).\r\n * Internal API for acquireTokenSilent.\r\n */\r\n AcquireTokenSilentAsync: \"acquireTokenSilentAsync\",\r\n /**\r\n * acquireTokenPopup (msal-browser).\r\n * Used to acquire a new access token interactively through pop ups\r\n */\r\n AcquireTokenPopup: \"acquireTokenPopup\",\r\n /**\r\n * acquireTokenPreRedirect (msal-browser).\r\n * First part of the redirect flow.\r\n * Used to acquire a new access token interactively through redirects.\r\n */\r\n AcquireTokenPreRedirect: \"acquireTokenPreRedirect\",\r\n /**\r\n * acquireTokenRedirect (msal-browser).\r\n * Second part of the redirect flow.\r\n * Used to acquire a new access token interactively through redirects.\r\n */\r\n AcquireTokenRedirect: \"acquireTokenRedirect\",\r\n /**\r\n * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).\r\n * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.\r\n */\r\n CryptoOptsGetPublicKeyThumbprint: \"cryptoOptsGetPublicKeyThumbprint\",\r\n /**\r\n * signJwt API in CryptoOpts class (msal-browser).\r\n * Used to signed a pop token.\r\n */\r\n CryptoOptsSignJwt: \"cryptoOptsSignJwt\",\r\n /**\r\n * acquireToken API in the SilentCacheClient class (msal-browser).\r\n * Used to read access tokens from the cache.\r\n */\r\n SilentCacheClientAcquireToken: \"silentCacheClientAcquireToken\",\r\n /**\r\n * acquireToken API in the SilentIframeClient class (msal-browser).\r\n * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.\r\n */\r\n SilentIframeClientAcquireToken: \"silentIframeClientAcquireToken\",\r\n AwaitConcurrentIframe: \"awaitConcurrentIframe\",\r\n /**\r\n * acquireToken API in SilentRereshClient (msal-browser).\r\n * Used to acquire a new set of tokens from the token endpoint using a refresh token.\r\n */\r\n SilentRefreshClientAcquireToken: \"silentRefreshClientAcquireToken\",\r\n /**\r\n * ssoSilent API (msal-browser).\r\n * Used to silently acquire an authorization code and set of tokens using a hidden iframe.\r\n */\r\n SsoSilent: \"ssoSilent\",\r\n /**\r\n * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).\r\n * Used to load authority metadata for a request.\r\n */\r\n StandardInteractionClientGetDiscoveredAuthority: \"standardInteractionClientGetDiscoveredAuthority\",\r\n /**\r\n * acquireToken APIs in msal-browser.\r\n * Used to make an /authorize endpoint call with native brokering enabled.\r\n */\r\n FetchAccountIdWithNativeBroker: \"fetchAccountIdWithNativeBroker\",\r\n /**\r\n * acquireToken API in NativeInteractionClient class (msal-browser).\r\n * Used to acquire a token from Native component when native brokering is enabled.\r\n */\r\n NativeInteractionClientAcquireToken: \"nativeInteractionClientAcquireToken\",\r\n /**\r\n * Time spent creating default headers for requests to token endpoint\r\n */\r\n BaseClientCreateTokenRequestHeaders: \"baseClientCreateTokenRequestHeaders\",\r\n /**\r\n * Time spent sending/waiting for the response of a request to the token endpoint\r\n */\r\n NetworkClientSendPostRequestAsync: \"networkClientSendPostRequestAsync\",\r\n RefreshTokenClientExecutePostToTokenEndpoint: \"refreshTokenClientExecutePostToTokenEndpoint\",\r\n AuthorizationCodeClientExecutePostToTokenEndpoint: \"authorizationCodeClientExecutePostToTokenEndpoint\",\r\n /**\r\n * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).\r\n */\r\n BrokerHandhshake: \"brokerHandshake\",\r\n /**\r\n * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .\r\n */\r\n AcquireTokenByRefreshTokenInBroker: \"acquireTokenByRefreshTokenInBroker\",\r\n /**\r\n * Time taken for token acquisition by broker\r\n */\r\n AcquireTokenByBroker: \"acquireTokenByBroker\",\r\n /**\r\n * Time spent on the network for refresh token acquisition\r\n */\r\n RefreshTokenClientExecuteTokenRequest: \"refreshTokenClientExecuteTokenRequest\",\r\n /**\r\n * Time taken for acquiring refresh token , records RT size\r\n */\r\n RefreshTokenClientAcquireToken: \"refreshTokenClientAcquireToken\",\r\n /**\r\n * Time taken for acquiring cached refresh token\r\n */\r\n RefreshTokenClientAcquireTokenWithCachedRefreshToken: \"refreshTokenClientAcquireTokenWithCachedRefreshToken\",\r\n /**\r\n * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).\r\n */\r\n RefreshTokenClientAcquireTokenByRefreshToken: \"refreshTokenClientAcquireTokenByRefreshToken\",\r\n /**\r\n * Helper function to create token request body in RefreshTokenClient (msal-common).\r\n */\r\n RefreshTokenClientCreateTokenRequestBody: \"refreshTokenClientCreateTokenRequestBody\",\r\n /**\r\n * acquireTokenFromCache (msal-browser).\r\n * Internal API for acquiring token from cache\r\n */\r\n AcquireTokenFromCache: \"acquireTokenFromCache\",\r\n SilentFlowClientAcquireCachedToken: \"silentFlowClientAcquireCachedToken\",\r\n SilentFlowClientGenerateResultFromCacheRecord: \"silentFlowClientGenerateResultFromCacheRecord\",\r\n /**\r\n * acquireTokenBySilentIframe (msal-browser).\r\n * Internal API for acquiring token by silent Iframe\r\n */\r\n AcquireTokenBySilentIframe: \"acquireTokenBySilentIframe\",\r\n /**\r\n * Internal API for initializing base request in BaseInteractionClient (msal-browser)\r\n */\r\n InitializeBaseRequest: \"initializeBaseRequest\",\r\n /**\r\n * Internal API for initializing silent request in SilentCacheClient (msal-browser)\r\n */\r\n InitializeSilentRequest: \"initializeSilentRequest\",\r\n InitializeClientApplication: \"initializeClientApplication\",\r\n InitializeCache: \"initializeCache\",\r\n /**\r\n * Helper function in SilentIframeClient class (msal-browser).\r\n */\r\n SilentIframeClientTokenHelper: \"silentIframeClientTokenHelper\",\r\n /**\r\n * SilentHandler\r\n */\r\n SilentHandlerInitiateAuthRequest: \"silentHandlerInitiateAuthRequest\",\r\n SilentHandlerMonitorIframeForHash: \"silentHandlerMonitorIframeForHash\",\r\n SilentHandlerLoadFrame: \"silentHandlerLoadFrame\",\r\n SilentHandlerLoadFrameSync: \"silentHandlerLoadFrameSync\",\r\n /**\r\n * Helper functions in StandardInteractionClient class (msal-browser)\r\n */\r\n StandardInteractionClientCreateAuthCodeClient: \"standardInteractionClientCreateAuthCodeClient\",\r\n StandardInteractionClientGetClientConfiguration: \"standardInteractionClientGetClientConfiguration\",\r\n StandardInteractionClientInitializeAuthorizationRequest: \"standardInteractionClientInitializeAuthorizationRequest\",\r\n /**\r\n * getAuthCodeUrl API (msal-browser and msal-node).\r\n */\r\n GetAuthCodeUrl: \"getAuthCodeUrl\",\r\n GetStandardParams: \"getStandardParams\",\r\n /**\r\n * Functions from InteractionHandler (msal-browser)\r\n */\r\n HandleCodeResponseFromServer: \"handleCodeResponseFromServer\",\r\n HandleCodeResponse: \"handleCodeResponse\",\r\n UpdateTokenEndpointAuthority: \"updateTokenEndpointAuthority\",\r\n /**\r\n * APIs in Authorization Code Client (msal-common)\r\n */\r\n AuthClientAcquireToken: \"authClientAcquireToken\",\r\n AuthClientExecuteTokenRequest: \"authClientExecuteTokenRequest\",\r\n AuthClientCreateTokenRequestBody: \"authClientCreateTokenRequestBody\",\r\n /**\r\n * Generate functions in PopTokenGenerator (msal-common)\r\n */\r\n PopTokenGenerateCnf: \"popTokenGenerateCnf\",\r\n PopTokenGenerateKid: \"popTokenGenerateKid\",\r\n /**\r\n * handleServerTokenResponse API in ResponseHandler (msal-common)\r\n */\r\n HandleServerTokenResponse: \"handleServerTokenResponse\",\r\n DeserializeResponse: \"deserializeResponse\",\r\n /**\r\n * Authority functions\r\n */\r\n AuthorityFactoryCreateDiscoveredInstance: \"authorityFactoryCreateDiscoveredInstance\",\r\n AuthorityResolveEndpointsAsync: \"authorityResolveEndpointsAsync\",\r\n AuthorityResolveEndpointsFromLocalSources: \"authorityResolveEndpointsFromLocalSources\",\r\n AuthorityGetCloudDiscoveryMetadataFromNetwork: \"authorityGetCloudDiscoveryMetadataFromNetwork\",\r\n AuthorityUpdateCloudDiscoveryMetadata: \"authorityUpdateCloudDiscoveryMetadata\",\r\n AuthorityGetEndpointMetadataFromNetwork: \"authorityGetEndpointMetadataFromNetwork\",\r\n AuthorityUpdateEndpointMetadata: \"authorityUpdateEndpointMetadata\",\r\n AuthorityUpdateMetadataWithRegionalInformation: \"authorityUpdateMetadataWithRegionalInformation\",\r\n /**\r\n * Region Discovery functions\r\n */\r\n RegionDiscoveryDetectRegion: \"regionDiscoveryDetectRegion\",\r\n RegionDiscoveryGetRegionFromIMDS: \"regionDiscoveryGetRegionFromIMDS\",\r\n RegionDiscoveryGetCurrentVersion: \"regionDiscoveryGetCurrentVersion\",\r\n AcquireTokenByCodeAsync: \"acquireTokenByCodeAsync\",\r\n GetEndpointMetadataFromNetwork: \"getEndpointMetadataFromNetwork\",\r\n GetCloudDiscoveryMetadataFromNetworkMeasurement: \"getCloudDiscoveryMetadataFromNetworkMeasurement\",\r\n HandleRedirectPromiseMeasurement: \"handleRedirectPromise\",\r\n HandleNativeRedirectPromiseMeasurement: \"handleNativeRedirectPromise\",\r\n UpdateCloudDiscoveryMetadataMeasurement: \"updateCloudDiscoveryMetadataMeasurement\",\r\n UsernamePasswordClientAcquireToken: \"usernamePasswordClientAcquireToken\",\r\n NativeMessageHandlerHandshake: \"nativeMessageHandlerHandshake\",\r\n NativeGenerateAuthResult: \"nativeGenerateAuthResult\",\r\n RemoveHiddenIframe: \"removeHiddenIframe\",\r\n /**\r\n * Cache operations\r\n */\r\n ClearTokensAndKeysWithClaims: \"clearTokensAndKeysWithClaims\",\r\n CacheManagerGetRefreshToken: \"cacheManagerGetRefreshToken\",\r\n ImportExistingCache: \"importExistingCache\",\r\n SetUserData: \"setUserData\",\r\n LocalStorageUpdated: \"localStorageUpdated\",\r\n /**\r\n * Crypto Operations\r\n */\r\n GeneratePkceCodes: \"generatePkceCodes\",\r\n GenerateCodeVerifier: \"generateCodeVerifier\",\r\n GenerateCodeChallengeFromVerifier: \"generateCodeChallengeFromVerifier\",\r\n Sha256Digest: \"sha256Digest\",\r\n GetRandomValues: \"getRandomValues\",\r\n GenerateHKDF: \"generateHKDF\",\r\n GenerateBaseKey: \"generateBaseKey\",\r\n Base64Decode: \"base64Decode\",\r\n UrlEncodeArr: \"urlEncodeArr\",\r\n Encrypt: \"encrypt\",\r\n Decrypt: \"decrypt\",\r\n};\r\nconst PerformanceEventAbbreviations = new Map([\r\n [PerformanceEvents.AcquireTokenByCode, \"ATByCode\"],\r\n [PerformanceEvents.AcquireTokenByRefreshToken, \"ATByRT\"],\r\n [PerformanceEvents.AcquireTokenSilent, \"ATS\"],\r\n [PerformanceEvents.AcquireTokenSilentAsync, \"ATSAsync\"],\r\n [PerformanceEvents.AcquireTokenPopup, \"ATPopup\"],\r\n [PerformanceEvents.AcquireTokenRedirect, \"ATRedirect\"],\r\n [\r\n PerformanceEvents.CryptoOptsGetPublicKeyThumbprint,\r\n \"CryptoGetPKThumb\",\r\n ],\r\n [PerformanceEvents.CryptoOptsSignJwt, \"CryptoSignJwt\"],\r\n [PerformanceEvents.SilentCacheClientAcquireToken, \"SltCacheClientAT\"],\r\n [PerformanceEvents.SilentIframeClientAcquireToken, \"SltIframeClientAT\"],\r\n [PerformanceEvents.SilentRefreshClientAcquireToken, \"SltRClientAT\"],\r\n [PerformanceEvents.SsoSilent, \"SsoSlt\"],\r\n [\r\n PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,\r\n \"StdIntClientGetDiscAuth\",\r\n ],\r\n [\r\n PerformanceEvents.FetchAccountIdWithNativeBroker,\r\n \"FetchAccIdWithNtvBroker\",\r\n ],\r\n [\r\n PerformanceEvents.NativeInteractionClientAcquireToken,\r\n \"NtvIntClientAT\",\r\n ],\r\n [\r\n PerformanceEvents.BaseClientCreateTokenRequestHeaders,\r\n \"BaseClientCreateTReqHead\",\r\n ],\r\n [\r\n PerformanceEvents.NetworkClientSendPostRequestAsync,\r\n \"NetClientSendPost\",\r\n ],\r\n [\r\n PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint,\r\n \"RTClientExecPost\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint,\r\n \"AuthCodeClientExecPost\",\r\n ],\r\n [PerformanceEvents.BrokerHandhshake, \"BrokerHandshake\"],\r\n [\r\n PerformanceEvents.AcquireTokenByRefreshTokenInBroker,\r\n \"ATByRTInBroker\",\r\n ],\r\n [PerformanceEvents.AcquireTokenByBroker, \"ATByBroker\"],\r\n [\r\n PerformanceEvents.RefreshTokenClientExecuteTokenRequest,\r\n \"RTClientExecTReq\",\r\n ],\r\n [PerformanceEvents.RefreshTokenClientAcquireToken, \"RTClientAT\"],\r\n [\r\n PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken,\r\n \"RTClientATWithCachedRT\",\r\n ],\r\n [\r\n PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken,\r\n \"RTClientATByRT\",\r\n ],\r\n [\r\n PerformanceEvents.RefreshTokenClientCreateTokenRequestBody,\r\n \"RTClientCreateTReqBody\",\r\n ],\r\n [PerformanceEvents.AcquireTokenFromCache, \"ATFromCache\"],\r\n [\r\n PerformanceEvents.SilentFlowClientAcquireCachedToken,\r\n \"SltFlowClientATCached\",\r\n ],\r\n [\r\n PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord,\r\n \"SltFlowClientGenResFromCache\",\r\n ],\r\n [PerformanceEvents.AcquireTokenBySilentIframe, \"ATBySltIframe\"],\r\n [PerformanceEvents.InitializeBaseRequest, \"InitBaseReq\"],\r\n [PerformanceEvents.InitializeSilentRequest, \"InitSltReq\"],\r\n [\r\n PerformanceEvents.InitializeClientApplication,\r\n \"InitClientApplication\",\r\n ],\r\n [PerformanceEvents.InitializeCache, \"InitCache\"],\r\n [PerformanceEvents.ImportExistingCache, \"importCache\"],\r\n [PerformanceEvents.SetUserData, \"setUserData\"],\r\n [PerformanceEvents.LocalStorageUpdated, \"localStorageUpdated\"],\r\n [PerformanceEvents.SilentIframeClientTokenHelper, \"SIClientTHelper\"],\r\n [\r\n PerformanceEvents.SilentHandlerInitiateAuthRequest,\r\n \"SHandlerInitAuthReq\",\r\n ],\r\n [\r\n PerformanceEvents.SilentHandlerMonitorIframeForHash,\r\n \"SltHandlerMonitorIframeForHash\",\r\n ],\r\n [PerformanceEvents.SilentHandlerLoadFrame, \"SHandlerLoadFrame\"],\r\n [PerformanceEvents.SilentHandlerLoadFrameSync, \"SHandlerLoadFrameSync\"],\r\n [\r\n PerformanceEvents.StandardInteractionClientCreateAuthCodeClient,\r\n \"StdIntClientCreateAuthCodeClient\",\r\n ],\r\n [\r\n PerformanceEvents.StandardInteractionClientGetClientConfiguration,\r\n \"StdIntClientGetClientConf\",\r\n ],\r\n [\r\n PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest,\r\n \"StdIntClientInitAuthReq\",\r\n ],\r\n [PerformanceEvents.GetAuthCodeUrl, \"GetAuthCodeUrl\"],\r\n [\r\n PerformanceEvents.HandleCodeResponseFromServer,\r\n \"HandleCodeResFromServer\",\r\n ],\r\n [PerformanceEvents.HandleCodeResponse, \"HandleCodeResp\"],\r\n [PerformanceEvents.UpdateTokenEndpointAuthority, \"UpdTEndpointAuth\"],\r\n [PerformanceEvents.AuthClientAcquireToken, \"AuthClientAT\"],\r\n [PerformanceEvents.AuthClientExecuteTokenRequest, \"AuthClientExecTReq\"],\r\n [\r\n PerformanceEvents.AuthClientCreateTokenRequestBody,\r\n \"AuthClientCreateTReqBody\",\r\n ],\r\n [PerformanceEvents.PopTokenGenerateCnf, \"PopTGenCnf\"],\r\n [PerformanceEvents.PopTokenGenerateKid, \"PopTGenKid\"],\r\n [PerformanceEvents.HandleServerTokenResponse, \"HandleServerTRes\"],\r\n [PerformanceEvents.DeserializeResponse, \"DeserializeRes\"],\r\n [\r\n PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,\r\n \"AuthFactCreateDiscInst\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityResolveEndpointsAsync,\r\n \"AuthResolveEndpointsAsync\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityResolveEndpointsFromLocalSources,\r\n \"AuthResolveEndpointsFromLocal\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,\r\n \"AuthGetCDMetaFromNet\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata,\r\n \"AuthUpdCDMeta\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,\r\n \"AuthUpdCDMetaFromNet\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityUpdateEndpointMetadata,\r\n \"AuthUpdEndpointMeta\",\r\n ],\r\n [\r\n PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,\r\n \"AuthUpdMetaWithRegInfo\",\r\n ],\r\n [PerformanceEvents.RegionDiscoveryDetectRegion, \"RegDiscDetectReg\"],\r\n [\r\n PerformanceEvents.RegionDiscoveryGetRegionFromIMDS,\r\n \"RegDiscGetRegFromIMDS\",\r\n ],\r\n [\r\n PerformanceEvents.RegionDiscoveryGetCurrentVersion,\r\n \"RegDiscGetCurrentVer\",\r\n ],\r\n [PerformanceEvents.AcquireTokenByCodeAsync, \"ATByCodeAsync\"],\r\n [\r\n PerformanceEvents.GetEndpointMetadataFromNetwork,\r\n \"GetEndpointMetaFromNet\",\r\n ],\r\n [\r\n PerformanceEvents.GetCloudDiscoveryMetadataFromNetworkMeasurement,\r\n \"GetCDMetaFromNet\",\r\n ],\r\n [\r\n PerformanceEvents.HandleRedirectPromiseMeasurement,\r\n \"HandleRedirectPromise\",\r\n ],\r\n [\r\n PerformanceEvents.HandleNativeRedirectPromiseMeasurement,\r\n \"HandleNtvRedirectPromise\",\r\n ],\r\n [\r\n PerformanceEvents.UpdateCloudDiscoveryMetadataMeasurement,\r\n \"UpdateCDMeta\",\r\n ],\r\n [\r\n PerformanceEvents.UsernamePasswordClientAcquireToken,\r\n \"UserPassClientAT\",\r\n ],\r\n [\r\n PerformanceEvents.NativeMessageHandlerHandshake,\r\n \"NtvMsgHandlerHandshake\",\r\n ],\r\n [PerformanceEvents.NativeGenerateAuthResult, \"NtvGenAuthRes\"],\r\n [PerformanceEvents.RemoveHiddenIframe, \"RemoveHiddenIframe\"],\r\n [\r\n PerformanceEvents.ClearTokensAndKeysWithClaims,\r\n \"ClearTAndKeysWithClaims\",\r\n ],\r\n [PerformanceEvents.CacheManagerGetRefreshToken, \"CacheManagerGetRT\"],\r\n [PerformanceEvents.GeneratePkceCodes, \"GenPkceCodes\"],\r\n [PerformanceEvents.GenerateCodeVerifier, \"GenCodeVerifier\"],\r\n [\r\n PerformanceEvents.GenerateCodeChallengeFromVerifier,\r\n \"GenCodeChallengeFromVerifier\",\r\n ],\r\n [PerformanceEvents.Sha256Digest, \"Sha256Digest\"],\r\n [PerformanceEvents.GetRandomValues, \"GetRandomValues\"],\r\n [PerformanceEvents.GenerateHKDF, \"genHKDF\"],\r\n [PerformanceEvents.GenerateBaseKey, \"genBaseKey\"],\r\n [PerformanceEvents.Base64Decode, \"b64Decode\"],\r\n [PerformanceEvents.UrlEncodeArr, \"urlEncArr\"],\r\n [PerformanceEvents.Encrypt, \"encrypt\"],\r\n [PerformanceEvents.Decrypt, \"decrypt\"],\r\n]);\r\n/**\r\n * State of the performance event.\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nconst PerformanceEventStatus = {\r\n NotStarted: 0,\r\n InProgress: 1,\r\n Completed: 2,\r\n};\r\nconst IntFields = new Set([\r\n \"accessTokenSize\",\r\n \"durationMs\",\r\n \"idTokenSize\",\r\n \"matsSilentStatus\",\r\n \"matsHttpStatus\",\r\n \"refreshTokenSize\",\r\n \"queuedTimeMs\",\r\n \"startTimeMs\",\r\n \"status\",\r\n \"multiMatchedAT\",\r\n \"multiMatchedID\",\r\n \"multiMatchedRT\",\r\n \"unencryptedCacheCount\",\r\n \"encryptedCacheExpiredCount\",\r\n]);\n\nexport { IntFields, PerformanceEventAbbreviations, PerformanceEventStatus, PerformanceEvents };\n//# sourceMappingURL=PerformanceEvent.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Wraps a function with a performance measurement.\r\n * Usage: invoke(functionToCall, performanceClient, \"EventName\", \"correlationId\")(...argsToPassToFunction)\r\n * @param callback\r\n * @param eventName\r\n * @param logger\r\n * @param telemetryClient\r\n * @param correlationId\r\n * @returns\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconst invoke = (callback, eventName, logger, telemetryClient, correlationId) => {\r\n return (...args) => {\r\n logger.trace(`Executing function ${eventName}`);\r\n const inProgressEvent = telemetryClient?.startMeasurement(eventName, correlationId);\r\n if (correlationId) {\r\n // Track number of times this API is called in a single request\r\n const eventCount = eventName + \"CallCount\";\r\n telemetryClient?.incrementFields({ [eventCount]: 1 }, correlationId);\r\n }\r\n try {\r\n const result = callback(...args);\r\n inProgressEvent?.end({\r\n success: true,\r\n });\r\n logger.trace(`Returning result from ${eventName}`);\r\n return result;\r\n }\r\n catch (e) {\r\n logger.trace(`Error occurred in ${eventName}`);\r\n try {\r\n logger.trace(JSON.stringify(e));\r\n }\r\n catch (e) {\r\n logger.trace(\"Unable to print error message.\");\r\n }\r\n inProgressEvent?.end({\r\n success: false,\r\n }, e);\r\n throw e;\r\n }\r\n };\r\n};\r\n/**\r\n * Wraps an async function with a performance measurement.\r\n * Usage: invokeAsync(functionToCall, performanceClient, \"EventName\", \"correlationId\")(...argsToPassToFunction)\r\n * @param callback\r\n * @param eventName\r\n * @param logger\r\n * @param telemetryClient\r\n * @param correlationId\r\n * @returns\r\n * @internal\r\n *\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconst invokeAsync = (callback, eventName, logger, telemetryClient, correlationId) => {\r\n return (...args) => {\r\n logger.trace(`Executing function ${eventName}`);\r\n const inProgressEvent = telemetryClient?.startMeasurement(eventName, correlationId);\r\n if (correlationId) {\r\n // Track number of times this API is called in a single request\r\n const eventCount = eventName + \"CallCount\";\r\n telemetryClient?.incrementFields({ [eventCount]: 1 }, correlationId);\r\n }\r\n telemetryClient?.setPreQueueTime(eventName, correlationId);\r\n return callback(...args)\r\n .then((response) => {\r\n logger.trace(`Returning result from ${eventName}`);\r\n inProgressEvent?.end({\r\n success: true,\r\n });\r\n return response;\r\n })\r\n .catch((e) => {\r\n logger.trace(`Error occurred in ${eventName}`);\r\n try {\r\n logger.trace(JSON.stringify(e));\r\n }\r\n catch (e) {\r\n logger.trace(\"Unable to print error message.\");\r\n }\r\n inProgressEvent?.end({\r\n success: false,\r\n }, e);\r\n throw e;\r\n });\r\n };\r\n};\n\nexport { invoke, invokeAsync };\n//# sourceMappingURL=FunctionWrappers.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants, ResponseCodes, RegionDiscoverySources } from '../utils/Constants.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass RegionDiscovery {\r\n constructor(networkInterface, logger, performanceClient, correlationId) {\r\n this.networkInterface = networkInterface;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n }\r\n /**\r\n * Detect the region from the application's environment.\r\n *\r\n * @returns Promise\r\n */\r\n async detectRegion(environmentRegion, regionDiscoveryMetadata) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);\r\n // Initialize auto detected region with the region from the envrionment\r\n let autodetectedRegionName = environmentRegion;\r\n // Check if a region was detected from the environment, if not, attempt to get the region from IMDS\r\n if (!autodetectedRegionName) {\r\n const options = RegionDiscovery.IMDS_OPTIONS;\r\n try {\r\n const localIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(Constants.IMDS_VERSION, options);\r\n if (localIMDSVersionResponse.status ===\r\n ResponseCodes.httpSuccess) {\r\n autodetectedRegionName = localIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.IMDS;\r\n }\r\n // If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry.\r\n if (localIMDSVersionResponse.status ===\r\n ResponseCodes.httpBadRequest) {\r\n const currentIMDSVersion = await invokeAsync(this.getCurrentVersion.bind(this), PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.logger, this.performanceClient, this.correlationId)(options);\r\n if (!currentIMDSVersion) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return null;\r\n }\r\n const currentIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(currentIMDSVersion, options);\r\n if (currentIMDSVersionResponse.status ===\r\n ResponseCodes.httpSuccess) {\r\n autodetectedRegionName =\r\n currentIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.IMDS;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return null;\r\n }\r\n }\r\n else {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.ENVIRONMENT_VARIABLE;\r\n }\r\n // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION\r\n if (!autodetectedRegionName) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n }\r\n return autodetectedRegionName || null;\r\n }\r\n /**\r\n * Make the call to the IMDS endpoint\r\n *\r\n * @param imdsEndpointUrl\r\n * @returns Promise>\r\n */\r\n async getRegionFromIMDS(version, options) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);\r\n return this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, Constants.IMDS_TIMEOUT);\r\n }\r\n /**\r\n * Get the most recent version of the IMDS endpoint available\r\n *\r\n * @returns Promise\r\n */\r\n async getCurrentVersion(options) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?format=json`, options);\r\n // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.\r\n if (response.status === ResponseCodes.httpBadRequest &&\r\n response.body &&\r\n response.body[\"newest-versions\"] &&\r\n response.body[\"newest-versions\"].length > 0) {\r\n return response.body[\"newest-versions\"][0];\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n }\r\n}\r\n// Options for the IMDS endpoint request\r\nRegionDiscovery.IMDS_OPTIONS = {\r\n headers: {\r\n Metadata: \"true\",\r\n },\r\n};\n\nexport { RegionDiscovery };\n//# sourceMappingURL=RegionDiscovery.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthorityType } from './AuthorityType.mjs';\nimport { isOpenIdConfigResponse } from './OpenIdConfigResponse.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes, AADAuthorityConstants } from '../utils/Constants.mjs';\nimport { EndpointMetadata, getCloudDiscoveryMetadataFromHardcodedValues, getCloudDiscoveryMetadataFromNetworkResponse, InstanceDiscoveryMetadataAliases } from './AuthorityMetadata.mjs';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { ProtocolMode } from './ProtocolMode.mjs';\nimport { AzureCloudInstance } from './AuthorityOptions.mjs';\nimport { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.mjs';\nimport { isCloudInstanceDiscoveryErrorResponse } from './CloudInstanceDiscoveryErrorResponse.mjs';\nimport { RegionDiscovery } from './RegionDiscovery.mjs';\nimport { AuthError } from '../error/AuthError.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { generateAuthorityMetadataExpiresAt, updateAuthorityEndpointMetadata, isAuthorityMetadataExpired, updateCloudDiscoveryMetadata } from '../cache/utils/CacheHelpers.mjs';\nimport { endpointResolutionError, endSessionEndpointNotSupported, openIdConfigError } from '../error/ClientAuthErrorCodes.mjs';\nimport { invalidAuthorityMetadata, untrustedAuthority, invalidCloudDiscoveryMetadata } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\r\n * endpoint. It will store the pertinent config data in this object for use during token calls.\r\n * @internal\r\n */\r\nclass Authority {\r\n constructor(authority, networkInterface, cacheManager, authorityOptions, logger, correlationId, performanceClient, managedIdentity) {\r\n this.canonicalAuthority = authority;\r\n this._canonicalAuthority.validateAsUri();\r\n this.networkInterface = networkInterface;\r\n this.cacheManager = cacheManager;\r\n this.authorityOptions = authorityOptions;\r\n this.regionDiscoveryMetadata = {\r\n region_used: undefined,\r\n region_source: undefined,\r\n region_outcome: undefined,\r\n };\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n this.managedIdentity = managedIdentity || false;\r\n this.regionDiscovery = new RegionDiscovery(networkInterface, this.logger, this.performanceClient, this.correlationId);\r\n }\r\n /**\r\n * Get {@link AuthorityType}\r\n * @param authorityUri {@link IUri}\r\n * @private\r\n */\r\n getAuthorityType(authorityUri) {\r\n // CIAM auth url pattern is being standardized as: .ciamlogin.com\r\n if (authorityUri.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {\r\n return AuthorityType.Ciam;\r\n }\r\n const pathSegments = authorityUri.PathSegments;\r\n if (pathSegments.length) {\r\n switch (pathSegments[0].toLowerCase()) {\r\n case Constants.ADFS:\r\n return AuthorityType.Adfs;\r\n case Constants.DSTS:\r\n return AuthorityType.Dsts;\r\n }\r\n }\r\n return AuthorityType.Default;\r\n }\r\n // See above for AuthorityType\r\n get authorityType() {\r\n return this.getAuthorityType(this.canonicalAuthorityUrlComponents);\r\n }\r\n /**\r\n * ProtocolMode enum representing the way endpoints are constructed.\r\n */\r\n get protocolMode() {\r\n return this.authorityOptions.protocolMode;\r\n }\r\n /**\r\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\r\n */\r\n get options() {\r\n return this.authorityOptions;\r\n }\r\n /**\r\n * A URL that is the authority set by the developer\r\n */\r\n get canonicalAuthority() {\r\n return this._canonicalAuthority.urlString;\r\n }\r\n /**\r\n * Sets canonical authority.\r\n */\r\n set canonicalAuthority(url) {\r\n this._canonicalAuthority = new UrlString(url);\r\n this._canonicalAuthority.validateAsUri();\r\n this._canonicalAuthorityUrlComponents = null;\r\n }\r\n /**\r\n * Get authority components.\r\n */\r\n get canonicalAuthorityUrlComponents() {\r\n if (!this._canonicalAuthorityUrlComponents) {\r\n this._canonicalAuthorityUrlComponents =\r\n this._canonicalAuthority.getUrlComponents();\r\n }\r\n return this._canonicalAuthorityUrlComponents;\r\n }\r\n /**\r\n * Get hostname and port i.e. login.microsoftonline.com\r\n */\r\n get hostnameAndPort() {\r\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\r\n }\r\n /**\r\n * Get tenant for authority.\r\n */\r\n get tenant() {\r\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\r\n }\r\n /**\r\n * OAuth /authorize endpoint for requests\r\n */\r\n get authorizationEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.authorization_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth /token endpoint for requests\r\n */\r\n get tokenEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.token_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n get deviceCodeEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth logout endpoint for requests\r\n */\r\n get endSessionEndpoint() {\r\n if (this.discoveryComplete()) {\r\n // ROPC policies may not have end_session_endpoint set\r\n if (!this.metadata.end_session_endpoint) {\r\n throw createClientAuthError(endSessionEndpointNotSupported);\r\n }\r\n return this.replacePath(this.metadata.end_session_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth issuer for requests\r\n */\r\n get selfSignedJwtAudience() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.issuer);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Jwks_uri for token signing keys\r\n */\r\n get jwksUri() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.jwks_uri);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}\r\n * @param authorityUri {@link IUri}\r\n * @private\r\n */\r\n canReplaceTenant(authorityUri) {\r\n return (authorityUri.PathSegments.length === 1 &&\r\n !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0]) &&\r\n this.getAuthorityType(authorityUri) === AuthorityType.Default &&\r\n this.protocolMode === ProtocolMode.AAD);\r\n }\r\n /**\r\n * Replaces tenant in url path with current tenant. Defaults to common.\r\n * @param urlString\r\n */\r\n replaceTenant(urlString) {\r\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\r\n }\r\n /**\r\n * Replaces path such as tenant or policy with the current tenant or policy.\r\n * @param urlString\r\n */\r\n replacePath(urlString) {\r\n let endpoint = urlString;\r\n const cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\r\n const cachedAuthorityUrlComponents = cachedAuthorityUrl.getUrlComponents();\r\n const cachedAuthorityParts = cachedAuthorityUrlComponents.PathSegments;\r\n const currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\r\n currentAuthorityParts.forEach((currentPart, index) => {\r\n let cachedPart = cachedAuthorityParts[index];\r\n if (index === 0 &&\r\n this.canReplaceTenant(cachedAuthorityUrlComponents)) {\r\n const tenantId = new UrlString(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];\r\n /**\r\n * Check if AAD canonical authority contains tenant domain name, for example \"testdomain.onmicrosoft.com\",\r\n * by comparing its first path segment to the corresponding authorization endpoint path segment, which is\r\n * always resolved with tenant id by OIDC.\r\n */\r\n if (cachedPart !== tenantId) {\r\n this.logger.verbose(`Replacing tenant domain name ${cachedPart} with id ${tenantId}`);\r\n cachedPart = tenantId;\r\n }\r\n }\r\n if (currentPart !== cachedPart) {\r\n endpoint = endpoint.replace(`/${cachedPart}/`, `/${currentPart}/`);\r\n }\r\n });\r\n return this.replaceTenant(endpoint);\r\n }\r\n /**\r\n * The default open id configuration endpoint for any canonical authority.\r\n */\r\n get defaultOpenIdConfigurationEndpoint() {\r\n const canonicalAuthorityHost = this.hostnameAndPort;\r\n if (this.canonicalAuthority.endsWith(\"v2.0/\") ||\r\n this.authorityType === AuthorityType.Adfs ||\r\n (this.protocolMode !== ProtocolMode.AAD &&\r\n !this.isAliasOfKnownMicrosoftAuthority(canonicalAuthorityHost))) {\r\n return `${this.canonicalAuthority}.well-known/openid-configuration`;\r\n }\r\n return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;\r\n }\r\n /**\r\n * Boolean that returns whether or not tenant discovery has been completed.\r\n */\r\n discoveryComplete() {\r\n return !!this.metadata;\r\n }\r\n /**\r\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\r\n * and the /authorize, /token and logout endpoints.\r\n */\r\n async resolveEndpointsAsync() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);\r\n const metadataEntity = this.getCurrentMetadataEntity();\r\n const cloudDiscoverySource = await invokeAsync(this.updateCloudDiscoveryMetadata.bind(this), PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);\r\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\r\n const endpointSource = await invokeAsync(this.updateEndpointMetadata.bind(this), PerformanceEvents.AuthorityUpdateEndpointMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);\r\n this.updateCachedMetadata(metadataEntity, cloudDiscoverySource, {\r\n source: endpointSource,\r\n });\r\n this.performanceClient?.addFields({\r\n cloudDiscoverySource: cloudDiscoverySource,\r\n authorityEndpointSource: endpointSource,\r\n }, this.correlationId);\r\n }\r\n /**\r\n * Returns metadata entity from cache if it exists, otherwiser returns a new metadata entity built\r\n * from the configured canonical authority\r\n * @returns\r\n */\r\n getCurrentMetadataEntity() {\r\n let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\r\n if (!metadataEntity) {\r\n metadataEntity = {\r\n aliases: [],\r\n preferred_cache: this.hostnameAndPort,\r\n preferred_network: this.hostnameAndPort,\r\n canonical_authority: this.canonicalAuthority,\r\n authorization_endpoint: \"\",\r\n token_endpoint: \"\",\r\n end_session_endpoint: \"\",\r\n issuer: \"\",\r\n aliasesFromNetwork: false,\r\n endpointsFromNetwork: false,\r\n expiresAt: generateAuthorityMetadataExpiresAt(),\r\n jwks_uri: \"\",\r\n };\r\n }\r\n return metadataEntity;\r\n }\r\n /**\r\n * Updates cached metadata based on metadata source and sets the instance's metadata\r\n * property to the same value\r\n * @param metadataEntity\r\n * @param cloudDiscoverySource\r\n * @param endpointMetadataResult\r\n */\r\n updateCachedMetadata(metadataEntity, cloudDiscoverySource, endpointMetadataResult) {\r\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&\r\n endpointMetadataResult?.source !== AuthorityMetadataSource.CACHE) {\r\n // Reset the expiration time unless both values came from a successful cache lookup\r\n metadataEntity.expiresAt =\r\n generateAuthorityMetadataExpiresAt();\r\n metadataEntity.canonical_authority = this.canonicalAuthority;\r\n }\r\n const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\r\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\r\n this.metadata = metadataEntity;\r\n }\r\n /**\r\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\r\n * @param metadataEntity\r\n */\r\n async updateEndpointMetadata(metadataEntity) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);\r\n const localMetadata = this.updateEndpointMetadataFromLocalSources(metadataEntity);\r\n // Further update may be required for hardcoded metadata if regional metadata is preferred\r\n if (localMetadata) {\r\n if (localMetadata.source ===\r\n AuthorityMetadataSource.HARDCODED_VALUES) {\r\n // If the user prefers to use an azure region replace the global endpoints with regional information.\r\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\r\n if (localMetadata.metadata) {\r\n const hardcodedMetadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(localMetadata.metadata);\r\n updateAuthorityEndpointMetadata(metadataEntity, hardcodedMetadata, false);\r\n metadataEntity.canonical_authority =\r\n this.canonicalAuthority;\r\n }\r\n }\r\n }\r\n return localMetadata.source;\r\n }\r\n // Get metadata from network if local sources aren't available\r\n let metadata = await invokeAsync(this.getEndpointMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();\r\n if (metadata) {\r\n // If the user prefers to use an azure region replace the global endpoints with regional information.\r\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\r\n metadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(metadata);\r\n }\r\n updateAuthorityEndpointMetadata(metadataEntity, metadata, true);\r\n return AuthorityMetadataSource.NETWORK;\r\n }\r\n else {\r\n // Metadata could not be obtained from the config, cache, network or hardcoded values\r\n throw createClientAuthError(openIdConfigError, this.defaultOpenIdConfigurationEndpoint);\r\n }\r\n }\r\n /**\r\n * Updates endpoint metadata from local sources and returns where the information was retrieved from and the metadata config\r\n * response if the source is hardcoded metadata\r\n * @param metadataEntity\r\n * @returns\r\n */\r\n updateEndpointMetadataFromLocalSources(metadataEntity) {\r\n this.logger.verbose(\"Attempting to get endpoint metadata from authority configuration\");\r\n const configMetadata = this.getEndpointMetadataFromConfig();\r\n if (configMetadata) {\r\n this.logger.verbose(\"Found endpoint metadata in authority configuration\");\r\n updateAuthorityEndpointMetadata(metadataEntity, configMetadata, false);\r\n return {\r\n source: AuthorityMetadataSource.CONFIG,\r\n };\r\n }\r\n this.logger.verbose(\"Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.\");\r\n // skipAuthorityMetadataCache is used to bypass hardcoded authority metadata and force a network metadata cache lookup and network metadata request if no cached response is available.\r\n if (this.authorityOptions.skipAuthorityMetadataCache) {\r\n this.logger.verbose(\"Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.\");\r\n }\r\n else {\r\n const hardcodedMetadata = this.getEndpointMetadataFromHardcodedValues();\r\n if (hardcodedMetadata) {\r\n updateAuthorityEndpointMetadata(metadataEntity, hardcodedMetadata, false);\r\n return {\r\n source: AuthorityMetadataSource.HARDCODED_VALUES,\r\n metadata: hardcodedMetadata,\r\n };\r\n }\r\n else {\r\n this.logger.verbose(\"Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.\");\r\n }\r\n }\r\n // Check cached metadata entity expiration status\r\n const metadataEntityExpired = isAuthorityMetadataExpired(metadataEntity);\r\n if (this.isAuthoritySameType(metadataEntity) &&\r\n metadataEntity.endpointsFromNetwork &&\r\n !metadataEntityExpired) {\r\n // No need to update\r\n this.logger.verbose(\"Found endpoint metadata in the cache.\");\r\n return { source: AuthorityMetadataSource.CACHE };\r\n }\r\n else if (metadataEntityExpired) {\r\n this.logger.verbose(\"The metadata entity is expired.\");\r\n }\r\n return null;\r\n }\r\n /**\r\n * Compares the number of url components after the domain to determine if the cached\r\n * authority metadata can be used for the requested authority. Protects against same domain different\r\n * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\r\n * @param metadataEntity\r\n */\r\n isAuthoritySameType(metadataEntity) {\r\n const cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\r\n const cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\r\n return (cachedParts.length ===\r\n this.canonicalAuthorityUrlComponents.PathSegments.length);\r\n }\r\n /**\r\n * Parse authorityMetadata config option\r\n */\r\n getEndpointMetadataFromConfig() {\r\n if (this.authorityOptions.authorityMetadata) {\r\n try {\r\n return JSON.parse(this.authorityOptions.authorityMetadata);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidAuthorityMetadata);\r\n }\r\n }\r\n return null;\r\n }\r\n /**\r\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n async getEndpointMetadataFromNetwork() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);\r\n const options = {};\r\n /*\r\n * TODO: Add a timeout if the authority exists in our library's\r\n * hardcoded list of metadata\r\n */\r\n const openIdConfigurationEndpoint = this.defaultOpenIdConfigurationEndpoint;\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${openIdConfigurationEndpoint}`);\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(openIdConfigurationEndpoint, options);\r\n const isValidResponse = isOpenIdConfigResponse(response.body);\r\n if (isValidResponse) {\r\n return response.body;\r\n }\r\n else {\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration`);\r\n return null;\r\n }\r\n }\r\n catch (e) {\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`);\r\n return null;\r\n }\r\n }\r\n /**\r\n * Get OAuth endpoints for common authorities.\r\n */\r\n getEndpointMetadataFromHardcodedValues() {\r\n if (this.hostnameAndPort in EndpointMetadata) {\r\n return EndpointMetadata[this.hostnameAndPort];\r\n }\r\n return null;\r\n }\r\n /**\r\n * Update the retrieved metadata with regional information.\r\n * User selected Azure region will be used if configured.\r\n */\r\n async updateMetadataWithRegionalInformation(metadata) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);\r\n const userConfiguredAzureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion;\r\n if (userConfiguredAzureRegion) {\r\n if (userConfiguredAzureRegion !==\r\n Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\r\n this.regionDiscoveryMetadata.region_used =\r\n userConfiguredAzureRegion;\r\n return Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion);\r\n }\r\n const autodetectedRegionName = await invokeAsync(this.regionDiscovery.detectRegion.bind(this.regionDiscovery), PerformanceEvents.RegionDiscoveryDetectRegion, this.logger, this.performanceClient, this.correlationId)(this.authorityOptions.azureRegionConfiguration\r\n ?.environmentRegion, this.regionDiscoveryMetadata);\r\n if (autodetectedRegionName) {\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;\r\n this.regionDiscoveryMetadata.region_used =\r\n autodetectedRegionName;\r\n return Authority.replaceWithRegionalInformation(metadata, autodetectedRegionName);\r\n }\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\r\n }\r\n return metadata;\r\n }\r\n /**\r\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache\r\n * and returns where the information was retrieved from\r\n * @param metadataEntity\r\n * @returns AuthorityMetadataSource\r\n */\r\n async updateCloudDiscoveryMetadata(metadataEntity) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);\r\n const localMetadataSource = this.updateCloudDiscoveryMetadataFromLocalSources(metadataEntity);\r\n if (localMetadataSource) {\r\n return localMetadataSource;\r\n }\r\n // Fallback to network as metadata source\r\n const metadata = await invokeAsync(this.getCloudDiscoveryMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();\r\n if (metadata) {\r\n updateCloudDiscoveryMetadata(metadataEntity, metadata, true);\r\n return AuthorityMetadataSource.NETWORK;\r\n }\r\n // Metadata could not be obtained from the config, cache, network or hardcoded values\r\n throw createClientConfigurationError(untrustedAuthority);\r\n }\r\n updateCloudDiscoveryMetadataFromLocalSources(metadataEntity) {\r\n this.logger.verbose(\"Attempting to get cloud discovery metadata from authority configuration\");\r\n this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities ||\r\n Constants.NOT_APPLICABLE}`);\r\n this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata ||\r\n Constants.NOT_APPLICABLE}`);\r\n this.logger.verbosePii(`Canonical Authority: ${metadataEntity.canonical_authority || Constants.NOT_APPLICABLE}`);\r\n const metadata = this.getCloudDiscoveryMetadataFromConfig();\r\n if (metadata) {\r\n this.logger.verbose(\"Found cloud discovery metadata in authority configuration\");\r\n updateCloudDiscoveryMetadata(metadataEntity, metadata, false);\r\n return AuthorityMetadataSource.CONFIG;\r\n }\r\n // If the cached metadata came from config but that config was not passed to this instance, we must go to hardcoded values\r\n this.logger.verbose(\"Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.\");\r\n if (this.options.skipAuthorityMetadataCache) {\r\n this.logger.verbose(\"Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.\");\r\n }\r\n else {\r\n const hardcodedMetadata = getCloudDiscoveryMetadataFromHardcodedValues(this.hostnameAndPort);\r\n if (hardcodedMetadata) {\r\n this.logger.verbose(\"Found cloud discovery metadata from hardcoded values.\");\r\n updateCloudDiscoveryMetadata(metadataEntity, hardcodedMetadata, false);\r\n return AuthorityMetadataSource.HARDCODED_VALUES;\r\n }\r\n this.logger.verbose(\"Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.\");\r\n }\r\n const metadataEntityExpired = isAuthorityMetadataExpired(metadataEntity);\r\n if (this.isAuthoritySameType(metadataEntity) &&\r\n metadataEntity.aliasesFromNetwork &&\r\n !metadataEntityExpired) {\r\n this.logger.verbose(\"Found cloud discovery metadata in the cache.\");\r\n // No need to update\r\n return AuthorityMetadataSource.CACHE;\r\n }\r\n else if (metadataEntityExpired) {\r\n this.logger.verbose(\"The metadata entity is expired.\");\r\n }\r\n return null;\r\n }\r\n /**\r\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\r\n */\r\n getCloudDiscoveryMetadataFromConfig() {\r\n // CIAM does not support cloud discovery metadata\r\n if (this.authorityType === AuthorityType.Ciam) {\r\n this.logger.verbose(\"CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n // Check if network response was provided in config\r\n if (this.authorityOptions.cloudDiscoveryMetadata) {\r\n this.logger.verbose(\"The cloud discovery metadata has been provided as a network response, in the config.\");\r\n try {\r\n this.logger.verbose(\"Attempting to parse the cloud discovery metadata.\");\r\n const parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata);\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);\r\n this.logger.verbose(\"Parsed the cloud discovery metadata.\");\r\n if (metadata) {\r\n this.logger.verbose(\"There is returnable metadata attached to the parsed cloud discovery metadata.\");\r\n return metadata;\r\n }\r\n else {\r\n this.logger.verbose(\"There is no metadata attached to the parsed cloud discovery metadata.\");\r\n }\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.\");\r\n throw createClientConfigurationError(invalidCloudDiscoveryMetadata);\r\n }\r\n }\r\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\r\n if (this.isInKnownAuthorities()) {\r\n this.logger.verbose(\"The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return null;\r\n }\r\n /**\r\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n async getCloudDiscoveryMetadataFromNetwork() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);\r\n const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;\r\n const options = {};\r\n /*\r\n * TODO: Add a timeout if the authority exists in our library's\r\n * hardcoded list of metadata\r\n */\r\n let match = null;\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options);\r\n let typedResponseBody;\r\n let metadata;\r\n if (isCloudInstanceDiscoveryResponse(response.body)) {\r\n typedResponseBody =\r\n response.body;\r\n metadata = typedResponseBody.metadata;\r\n this.logger.verbosePii(`tenant_discovery_endpoint is: ${typedResponseBody.tenant_discovery_endpoint}`);\r\n }\r\n else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {\r\n this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${response.status}`);\r\n typedResponseBody =\r\n response.body;\r\n if (typedResponseBody.error === Constants.INVALID_INSTANCE) {\r\n this.logger.error(\"The CloudInstanceDiscoveryErrorResponse error is invalid_instance.\");\r\n return null;\r\n }\r\n this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${typedResponseBody.error}`);\r\n this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${typedResponseBody.error_description}`);\r\n this.logger.warning(\"Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []\");\r\n metadata = [];\r\n }\r\n else {\r\n this.logger.error(\"AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse\");\r\n return null;\r\n }\r\n this.logger.verbose(\"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n match = getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);\r\n }\r\n catch (error) {\r\n if (error instanceof AuthError) {\r\n this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\\nError: ${error.errorCode}\\nError Description: ${error.errorMessage}`);\r\n }\r\n else {\r\n const typedError = error;\r\n this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\\nError: ${typedError.name}\\nError Description: ${typedError.message}`);\r\n }\r\n return null;\r\n }\r\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\r\n if (!match) {\r\n this.logger.warning(\"The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n this.logger.verbose(\"Creating custom Authority for custom domain scenario.\");\r\n match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return match;\r\n }\r\n /**\r\n * Helper function to determine if this host is included in the knownAuthorities config option\r\n */\r\n isInKnownAuthorities() {\r\n const matches = this.authorityOptions.knownAuthorities.filter((authority) => {\r\n return (authority &&\r\n UrlString.getDomainFromUrl(authority).toLowerCase() ===\r\n this.hostnameAndPort);\r\n });\r\n return matches.length > 0;\r\n }\r\n /**\r\n * helper function to populate the authority based on azureCloudOptions\r\n * @param authorityString\r\n * @param azureCloudOptions\r\n */\r\n static generateAuthority(authorityString, azureCloudOptions) {\r\n let authorityAzureCloudInstance;\r\n if (azureCloudOptions &&\r\n azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {\r\n const tenant = azureCloudOptions.tenant\r\n ? azureCloudOptions.tenant\r\n : Constants.DEFAULT_COMMON_TENANT;\r\n authorityAzureCloudInstance = `${azureCloudOptions.azureCloudInstance}/${tenant}/`;\r\n }\r\n return authorityAzureCloudInstance\r\n ? authorityAzureCloudInstance\r\n : authorityString;\r\n }\r\n /**\r\n * Creates cloud discovery metadata object from a given host\r\n * @param host\r\n */\r\n static createCloudDiscoveryMetadataFromHost(host) {\r\n return {\r\n preferred_network: host,\r\n preferred_cache: host,\r\n aliases: [host],\r\n };\r\n }\r\n /**\r\n * helper function to generate environment from authority object\r\n */\r\n getPreferredCache() {\r\n if (this.managedIdentity) {\r\n return Constants.DEFAULT_AUTHORITY_HOST;\r\n }\r\n else if (this.discoveryComplete()) {\r\n return this.metadata.preferred_cache;\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Returns whether or not the provided host is an alias of this authority instance\r\n * @param host\r\n */\r\n isAlias(host) {\r\n return this.metadata.aliases.indexOf(host) > -1;\r\n }\r\n /**\r\n * Returns whether or not the provided host is an alias of a known Microsoft authority for purposes of endpoint discovery\r\n * @param host\r\n */\r\n isAliasOfKnownMicrosoftAuthority(host) {\r\n return InstanceDiscoveryMetadataAliases.has(host);\r\n }\r\n /**\r\n * Checks whether the provided host is that of a public cloud authority\r\n *\r\n * @param authority string\r\n * @returns bool\r\n */\r\n static isPublicCloudAuthority(host) {\r\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\r\n }\r\n /**\r\n * Rebuild the authority string with the region\r\n *\r\n * @param host string\r\n * @param region string\r\n */\r\n static buildRegionalAuthorityString(host, region, queryString) {\r\n // Create and validate a Url string object with the initial authority string\r\n const authorityUrlInstance = new UrlString(host);\r\n authorityUrlInstance.validateAsUri();\r\n const authorityUrlParts = authorityUrlInstance.getUrlComponents();\r\n let hostNameAndPort = `${region}.${authorityUrlParts.HostNameAndPort}`;\r\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\r\n hostNameAndPort = `${region}.${Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`;\r\n }\r\n // Include the query string portion of the url\r\n const url = UrlString.constructAuthorityUriFromObject({\r\n ...authorityUrlInstance.getUrlComponents(),\r\n HostNameAndPort: hostNameAndPort,\r\n }).urlString;\r\n // Add the query string if a query string was provided\r\n if (queryString)\r\n return `${url}?${queryString}`;\r\n return url;\r\n }\r\n /**\r\n * Replace the endpoints in the metadata object with their regional equivalents.\r\n *\r\n * @param metadata OpenIdConfigResponse\r\n * @param azureRegion string\r\n */\r\n static replaceWithRegionalInformation(metadata, azureRegion) {\r\n const regionalMetadata = { ...metadata };\r\n regionalMetadata.authorization_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.authorization_endpoint, azureRegion);\r\n regionalMetadata.token_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.token_endpoint, azureRegion);\r\n if (regionalMetadata.end_session_endpoint) {\r\n regionalMetadata.end_session_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.end_session_endpoint, azureRegion);\r\n }\r\n return regionalMetadata;\r\n }\r\n /**\r\n * Transform CIAM_AUTHORIY as per the below rules:\r\n * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it\r\n *\r\n * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`\r\n * `ciamlogin.com` can also change in the future and we should accommodate the same\r\n *\r\n * @param authority\r\n */\r\n static transformCIAMAuthority(authority) {\r\n let ciamAuthority = authority;\r\n const authorityUrl = new UrlString(authority);\r\n const authorityUrlComponents = authorityUrl.getUrlComponents();\r\n // check if transformation is needed\r\n if (authorityUrlComponents.PathSegments.length === 0 &&\r\n authorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {\r\n const tenantIdOrDomain = authorityUrlComponents.HostNameAndPort.split(\".\")[0];\r\n ciamAuthority = `${ciamAuthority}${tenantIdOrDomain}${Constants.AAD_TENANT_DOMAIN_SUFFIX}`;\r\n }\r\n return ciamAuthority;\r\n }\r\n}\r\n// Reserved tenant domain names that will not be replaced with tenant id\r\nAuthority.reservedTenantDomains = new Set([\r\n \"{tenant}\",\r\n \"{tenantid}\",\r\n AADAuthorityConstants.COMMON,\r\n AADAuthorityConstants.CONSUMERS,\r\n AADAuthorityConstants.ORGANIZATIONS,\r\n]);\r\n/**\r\n * Extract tenantId from authority\r\n */\r\nfunction getTenantFromAuthorityString(authority) {\r\n const authorityUrl = new UrlString(authority);\r\n const authorityUrlComponents = authorityUrl.getUrlComponents();\r\n /**\r\n * For credential matching purposes, tenantId is the last path segment of the authority URL:\r\n * AAD Authority - domain/tenantId -> Credentials are cached with realm = tenantId\r\n * B2C Authority - domain/{tenantId}?/.../policy -> Credentials are cached with realm = policy\r\n * tenantId is downcased because B2C policies can have mixed case but tfp claim is downcased\r\n *\r\n * Note that we may not have any path segments in certain OIDC scenarios.\r\n */\r\n const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]?.toLowerCase();\r\n switch (tenantId) {\r\n case AADAuthorityConstants.COMMON:\r\n case AADAuthorityConstants.ORGANIZATIONS:\r\n case AADAuthorityConstants.CONSUMERS:\r\n return undefined;\r\n default:\r\n return tenantId;\r\n }\r\n}\r\nfunction formatAuthorityUri(authorityUri) {\r\n return authorityUri.endsWith(Constants.FORWARD_SLASH)\r\n ? authorityUri\r\n : `${authorityUri}${Constants.FORWARD_SLASH}`;\r\n}\r\nfunction buildStaticAuthorityOptions(authOptions) {\r\n const rawCloudDiscoveryMetadata = authOptions.cloudDiscoveryMetadata;\r\n let cloudDiscoveryMetadata = undefined;\r\n if (rawCloudDiscoveryMetadata) {\r\n try {\r\n cloudDiscoveryMetadata = JSON.parse(rawCloudDiscoveryMetadata);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidCloudDiscoveryMetadata);\r\n }\r\n }\r\n return {\r\n canonicalAuthority: authOptions.authority\r\n ? formatAuthorityUri(authOptions.authority)\r\n : undefined,\r\n knownAuthorities: authOptions.knownAuthorities,\r\n cloudDiscoveryMetadata: cloudDiscoveryMetadata,\r\n };\r\n}\n\nexport { Authority, buildStaticAuthorityOptions, formatAuthorityUri, getTenantFromAuthorityString };\n//# sourceMappingURL=Authority.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Authority, formatAuthorityUri } from './Authority.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { endpointResolutionError } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\r\n *\r\n * Also performs endpoint discovery.\r\n *\r\n * @param authorityUri\r\n * @param networkClient\r\n * @param protocolMode\r\n * @internal\r\n */\r\nasync function createDiscoveredInstance(authorityUri, networkClient, cacheManager, authorityOptions, logger, correlationId, performanceClient) {\r\n performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);\r\n const authorityUriFinal = Authority.transformCIAMAuthority(formatAuthorityUri(authorityUri));\r\n // Initialize authority and perform discovery endpoint check.\r\n const acquireTokenAuthority = new Authority(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, correlationId, performanceClient);\r\n try {\r\n await invokeAsync(acquireTokenAuthority.resolveEndpointsAsync.bind(acquireTokenAuthority), PerformanceEvents.AuthorityResolveEndpointsAsync, logger, performanceClient, correlationId)();\r\n return acquireTokenAuthority;\r\n }\r\n catch (e) {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n}\n\nexport { createDiscoveredInstance };\n//# sourceMappingURL=AuthorityFactory.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthError } from './AuthError.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Error thrown when there is an error with the server code, for example, unavailability.\r\n */\r\nclass ServerError extends AuthError {\r\n constructor(errorCode, errorMessage, subError, errorNo, status) {\r\n super(errorCode, errorMessage, subError);\r\n this.name = \"ServerError\";\r\n this.errorNo = errorNo;\r\n this.status = status;\r\n Object.setPrototypeOf(this, ServerError.prototype);\r\n }\r\n}\n\nexport { ServerError };\n//# sourceMappingURL=ServerError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction getRequestThumbprint(clientId, request, homeAccountId) {\r\n return {\r\n clientId: clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n homeAccountIdentifier: homeAccountId,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid,\r\n embeddedClientId: request.embeddedClientId || request.tokenBodyParameters?.clientId,\r\n };\r\n}\n\nexport { getRequestThumbprint };\n//# sourceMappingURL=RequestThumbprint.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { ThrottlingConstants, Constants, HeaderNames } from '../utils/Constants.mjs';\nimport { ServerError } from '../error/ServerError.mjs';\nimport { getRequestThumbprint } from './RequestThumbprint.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/** @internal */\r\nclass ThrottlingUtils {\r\n /**\r\n * Prepares a RequestThumbprint to be stored as a key.\r\n * @param thumbprint\r\n */\r\n static generateThrottlingStorageKey(thumbprint) {\r\n return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;\r\n }\r\n /**\r\n * Performs necessary throttling checks before a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n */\r\n static preProcess(cacheManager, thumbprint) {\r\n const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);\r\n const value = cacheManager.getThrottlingCache(key);\r\n if (value) {\r\n if (value.throttleTime < Date.now()) {\r\n cacheManager.removeItem(key);\r\n return;\r\n }\r\n throw new ServerError(value.errorCodes?.join(\" \") || Constants.EMPTY_STRING, value.errorMessage, value.subError);\r\n }\r\n }\r\n /**\r\n * Performs necessary throttling checks after a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n * @param response\r\n */\r\n static postProcess(cacheManager, thumbprint, response) {\r\n if (ThrottlingUtils.checkResponseStatus(response) ||\r\n ThrottlingUtils.checkResponseForRetryAfter(response)) {\r\n const thumbprintValue = {\r\n throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),\r\n error: response.body.error,\r\n errorCodes: response.body.error_codes,\r\n errorMessage: response.body.error_description,\r\n subError: response.body.suberror,\r\n };\r\n cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);\r\n }\r\n }\r\n /**\r\n * Checks a NetworkResponse object's status codes against 429 or 5xx\r\n * @param response\r\n */\r\n static checkResponseStatus(response) {\r\n return (response.status === 429 ||\r\n (response.status >= 500 && response.status < 600));\r\n }\r\n /**\r\n * Checks a NetworkResponse object's RetryAfter header\r\n * @param response\r\n */\r\n static checkResponseForRetryAfter(response) {\r\n if (response.headers) {\r\n return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&\r\n (response.status < 200 || response.status >= 300));\r\n }\r\n return false;\r\n }\r\n /**\r\n * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.\r\n * @param throttleTime\r\n */\r\n static calculateThrottleTime(throttleTime) {\r\n const time = throttleTime <= 0 ? 0 : throttleTime;\r\n const currentSeconds = Date.now() / 1000;\r\n return Math.floor(Math.min(currentSeconds +\r\n (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds +\r\n ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);\r\n }\r\n static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {\r\n const thumbprint = getRequestThumbprint(clientId, request, homeAccountIdentifier);\r\n const key = this.generateThrottlingStorageKey(thumbprint);\r\n cacheManager.removeItem(key);\r\n }\r\n}\n\nexport { ThrottlingUtils };\n//# sourceMappingURL=ThrottlingUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthError } from './AuthError.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Represents network related errors\r\n */\r\nclass NetworkError extends AuthError {\r\n constructor(error, httpStatus, responseHeaders) {\r\n super(error.errorCode, error.errorMessage, error.subError);\r\n Object.setPrototypeOf(this, NetworkError.prototype);\r\n this.name = \"NetworkError\";\r\n this.error = error;\r\n this.httpStatus = httpStatus;\r\n this.responseHeaders = responseHeaders;\r\n }\r\n}\r\n/**\r\n * Creates NetworkError object for a failed network request\r\n * @param error - Error to be thrown back to the caller\r\n * @param httpStatus - Status code of the network request\r\n * @param responseHeaders - Response headers of the network request, when available\r\n * @returns NetworkError object\r\n */\r\nfunction createNetworkError(error, httpStatus, responseHeaders) {\r\n return new NetworkError(error, httpStatus, responseHeaders);\r\n}\n\nexport { NetworkError, createNetworkError };\n//# sourceMappingURL=NetworkError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { buildClientConfiguration } from '../config/ClientConfiguration.mjs';\nimport { Logger } from '../logger/Logger.mjs';\nimport { HeaderNames, Constants } from '../utils/Constants.mjs';\nimport { name, version } from '../packageMetadata.mjs';\nimport { CcsCredentialType } from '../account/CcsCredential.mjs';\nimport { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';\nimport { addBrokerParameters, addExtraQueryParameters, addCorrelationId, instrumentBrokerParams } from '../request/RequestParameterBuilder.mjs';\nimport { mapToQueryString } from '../utils/UrlUtils.mjs';\nimport { createDiscoveredInstance } from '../authority/AuthorityFactory.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { ThrottlingUtils } from '../network/ThrottlingUtils.mjs';\nimport { AuthError } from '../error/AuthError.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { NetworkError } from '../error/NetworkError.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { networkError } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.\r\n * @internal\r\n */\r\nclass BaseClient {\r\n constructor(configuration, performanceClient) {\r\n // Set the configuration\r\n this.config = buildClientConfiguration(configuration);\r\n // Initialize the logger\r\n this.logger = new Logger(this.config.loggerOptions, name, version);\r\n // Initialize crypto\r\n this.cryptoUtils = this.config.cryptoInterface;\r\n // Initialize storage interface\r\n this.cacheManager = this.config.storageInterface;\r\n // Set the network interface\r\n this.networkClient = this.config.networkInterface;\r\n // Set TelemetryManager\r\n this.serverTelemetryManager = this.config.serverTelemetryManager;\r\n // set Authority\r\n this.authority = this.config.authOptions.authority;\r\n // set performance telemetry client\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Creates default headers for requests to token endpoint\r\n */\r\n createTokenRequestHeaders(ccsCred) {\r\n const headers = {};\r\n headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;\r\n if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {\r\n switch (ccsCred.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\r\n headers[HeaderNames.CCS_HEADER] = `Oid:${clientInfo.uid}@${clientInfo.utid}`;\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" +\r\n e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n headers[HeaderNames.CCS_HEADER] = `UPN: ${ccsCred.credential}`;\r\n break;\r\n }\r\n }\r\n return headers;\r\n }\r\n /**\r\n * Http post to token endpoint\r\n * @param tokenEndpoint\r\n * @param queryString\r\n * @param headers\r\n * @param thumbprint\r\n */\r\n async executePostToTokenEndpoint(tokenEndpoint, queryString, headers, thumbprint, correlationId, queuedEvent) {\r\n if (queuedEvent) {\r\n this.performanceClient?.addQueueMeasurement(queuedEvent, correlationId);\r\n }\r\n const response = await this.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers }, correlationId);\r\n if (this.config.serverTelemetryManager &&\r\n response.status < 500 &&\r\n response.status !== 429) {\r\n // Telemetry data successfully logged by server, clear Telemetry cache\r\n this.config.serverTelemetryManager.clearTelemetryCache();\r\n }\r\n return response;\r\n }\r\n /**\r\n * Wraps sendPostRequestAsync with necessary preflight and postflight logic\r\n * @param thumbprint - Request thumbprint for throttling\r\n * @param tokenEndpoint - Endpoint to make the POST to\r\n * @param options - Body and Headers to include on the POST request\r\n * @param correlationId - CorrelationId for telemetry\r\n */\r\n async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {\r\n ThrottlingUtils.preProcess(this.cacheManager, thumbprint);\r\n let response;\r\n try {\r\n response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);\r\n const responseHeaders = response.headers || {};\r\n this.performanceClient?.addFields({\r\n refreshTokenSize: response.body.refresh_token?.length || 0,\r\n httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || \"\",\r\n requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || \"\",\r\n }, correlationId);\r\n }\r\n catch (e) {\r\n if (e instanceof NetworkError) {\r\n const responseHeaders = e.responseHeaders;\r\n if (responseHeaders) {\r\n this.performanceClient?.addFields({\r\n httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || \"\",\r\n requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] ||\r\n \"\",\r\n contentTypeHeader: responseHeaders[HeaderNames.CONTENT_TYPE] ||\r\n undefined,\r\n contentLengthHeader: responseHeaders[HeaderNames.CONTENT_LENGTH] ||\r\n undefined,\r\n httpStatus: e.httpStatus,\r\n }, correlationId);\r\n }\r\n throw e.error;\r\n }\r\n if (e instanceof AuthError) {\r\n throw e;\r\n }\r\n else {\r\n throw createClientAuthError(networkError);\r\n }\r\n }\r\n ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);\r\n return response;\r\n }\r\n /**\r\n * Updates the authority object of the client. Endpoint discovery must be completed.\r\n * @param updatedAuthority\r\n */\r\n async updateAuthority(cloudInstanceHostname, correlationId) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.UpdateTokenEndpointAuthority, correlationId);\r\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${this.authority.tenant}/`;\r\n const cloudInstanceAuthority = await createDiscoveredInstance(cloudInstanceAuthorityUri, this.networkClient, this.cacheManager, this.authority.options, this.logger, correlationId, this.performanceClient);\r\n this.authority = cloudInstanceAuthority;\r\n }\r\n /**\r\n * Creates query string for the /token request\r\n * @param request\r\n */\r\n createTokenQueryParameters(request) {\r\n const parameters = new Map();\r\n if (request.embeddedClientId) {\r\n addBrokerParameters(parameters, this.config.authOptions.clientId, this.config.authOptions.redirectUri);\r\n }\r\n if (request.tokenQueryParameters) {\r\n addExtraQueryParameters(parameters, request.tokenQueryParameters);\r\n }\r\n addCorrelationId(parameters, request.correlationId);\r\n instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);\r\n return mapToQueryString(parameters);\r\n }\r\n}\n\nexport { BaseClient };\n//# sourceMappingURL=BaseClient.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Codes defined by MSAL\r\nconst noTokensFound = \"no_tokens_found\";\r\nconst nativeAccountUnavailable = \"native_account_unavailable\";\r\nconst refreshTokenExpired = \"refresh_token_expired\";\r\n// Codes potentially returned by server\r\nconst interactionRequired = \"interaction_required\";\r\nconst consentRequired = \"consent_required\";\r\nconst loginRequired = \"login_required\";\r\nconst badToken = \"bad_token\";\n\nexport { badToken, consentRequired, interactionRequired, loginRequired, nativeAccountUnavailable, noTokensFound, refreshTokenExpired };\n//# sourceMappingURL=InteractionRequiredAuthErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants } from '../utils/Constants.mjs';\nimport { AuthError } from './AuthError.mjs';\nimport { noTokensFound, nativeAccountUnavailable, badToken, refreshTokenExpired, interactionRequired, consentRequired, loginRequired } from './InteractionRequiredAuthErrorCodes.mjs';\nimport * as InteractionRequiredAuthErrorCodes from './InteractionRequiredAuthErrorCodes.mjs';\nexport { InteractionRequiredAuthErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\r\n */\r\nconst InteractionRequiredServerErrorMessage = [\r\n interactionRequired,\r\n consentRequired,\r\n loginRequired,\r\n badToken,\r\n];\r\nconst InteractionRequiredAuthSubErrorMessage = [\r\n \"message_only\",\r\n \"additional_action\",\r\n \"basic_action\",\r\n \"user_password_expired\",\r\n \"consent_required\",\r\n \"bad_token\",\r\n];\r\nconst InteractionRequiredAuthErrorMessages = {\r\n [noTokensFound]: \"No refresh token found in the cache. Please sign-in.\",\r\n [nativeAccountUnavailable]: \"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.\",\r\n [refreshTokenExpired]: \"Refresh token has expired.\",\r\n [badToken]: \"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.\",\r\n};\r\n/**\r\n * Interaction required errors defined by the SDK\r\n * @deprecated Use InteractionRequiredAuthErrorCodes instead\r\n */\r\nconst InteractionRequiredAuthErrorMessage = {\r\n noTokensFoundError: {\r\n code: noTokensFound,\r\n desc: InteractionRequiredAuthErrorMessages[noTokensFound],\r\n },\r\n native_account_unavailable: {\r\n code: nativeAccountUnavailable,\r\n desc: InteractionRequiredAuthErrorMessages[nativeAccountUnavailable],\r\n },\r\n bad_token: {\r\n code: badToken,\r\n desc: InteractionRequiredAuthErrorMessages[badToken],\r\n },\r\n};\r\n/**\r\n * Error thrown when user interaction is required.\r\n */\r\nclass InteractionRequiredAuthError extends AuthError {\r\n constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {\r\n super(errorCode, errorMessage, subError);\r\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\r\n this.timestamp = timestamp || Constants.EMPTY_STRING;\r\n this.traceId = traceId || Constants.EMPTY_STRING;\r\n this.correlationId = correlationId || Constants.EMPTY_STRING;\r\n this.claims = claims || Constants.EMPTY_STRING;\r\n this.name = \"InteractionRequiredAuthError\";\r\n this.errorNo = errorNo;\r\n }\r\n}\r\n/**\r\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\r\n * @param errorCode\r\n * @param errorString\r\n * @param subError\r\n */\r\nfunction isInteractionRequiredError(errorCode, errorString, subError) {\r\n const isInteractionRequiredErrorCode = !!errorCode &&\r\n InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\r\n const isInteractionRequiredSubError = !!subError &&\r\n InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\r\n const isInteractionRequiredErrorDesc = !!errorString &&\r\n InteractionRequiredServerErrorMessage.some((irErrorCode) => {\r\n return errorString.indexOf(irErrorCode) > -1;\r\n });\r\n return (isInteractionRequiredErrorCode ||\r\n isInteractionRequiredErrorDesc ||\r\n isInteractionRequiredSubError);\r\n}\r\n/**\r\n * Creates an InteractionRequiredAuthError\r\n */\r\nfunction createInteractionRequiredAuthError(errorCode) {\r\n return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);\r\n}\n\nexport { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, InteractionRequiredAuthSubErrorMessage, InteractionRequiredServerErrorMessage, createInteractionRequiredAuthError, isInteractionRequiredError };\n//# sourceMappingURL=InteractionRequiredAuthError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { Constants } from './Constants.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { noCryptoObject, invalidState } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Class which provides helpers for OAuth 2.0 protocol specific values\r\n */\r\nclass ProtocolUtils {\r\n /**\r\n * Appends user state with random guid, or returns random guid.\r\n * @param userState\r\n * @param randomGuid\r\n */\r\n static setRequestState(cryptoObj, userState, meta) {\r\n const libraryState = ProtocolUtils.generateLibraryState(cryptoObj, meta);\r\n return userState\r\n ? `${libraryState}${Constants.RESOURCE_DELIM}${userState}`\r\n : libraryState;\r\n }\r\n /**\r\n * Generates the state value used by the common library.\r\n * @param randomGuid\r\n * @param cryptoObj\r\n */\r\n static generateLibraryState(cryptoObj, meta) {\r\n if (!cryptoObj) {\r\n throw createClientAuthError(noCryptoObject);\r\n }\r\n // Create a state object containing a unique id and the timestamp of the request creation\r\n const stateObj = {\r\n id: cryptoObj.createNewGuid(),\r\n };\r\n if (meta) {\r\n stateObj.meta = meta;\r\n }\r\n const stateString = JSON.stringify(stateObj);\r\n return cryptoObj.base64Encode(stateString);\r\n }\r\n /**\r\n * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.\r\n * @param state\r\n * @param cryptoObj\r\n */\r\n static parseRequestState(cryptoObj, state) {\r\n if (!cryptoObj) {\r\n throw createClientAuthError(noCryptoObject);\r\n }\r\n if (!state) {\r\n throw createClientAuthError(invalidState);\r\n }\r\n try {\r\n // Split the state between library state and user passed state and decode them separately\r\n const splitState = state.split(Constants.RESOURCE_DELIM);\r\n const libraryState = splitState[0];\r\n const userState = splitState.length > 1\r\n ? splitState.slice(1).join(Constants.RESOURCE_DELIM)\r\n : Constants.EMPTY_STRING;\r\n const libraryStateString = cryptoObj.base64Decode(libraryState);\r\n const libraryStateObj = JSON.parse(libraryStateString);\r\n return {\r\n userRequestState: userState || Constants.EMPTY_STRING,\r\n libraryState: libraryStateObj,\r\n };\r\n }\r\n catch (e) {\r\n throw createClientAuthError(invalidState);\r\n }\r\n }\r\n}\n\nexport { ProtocolUtils };\n//# sourceMappingURL=ProtocolUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { nowSeconds } from '../utils/TimeUtils.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst KeyLocation = {\r\n SW: \"sw\",\r\n UHW: \"uhw\",\r\n};\r\n/** @internal */\r\nclass PopTokenGenerator {\r\n constructor(cryptoUtils, performanceClient) {\r\n this.cryptoUtils = cryptoUtils;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\r\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\r\n * @param request\r\n * @returns\r\n */\r\n async generateCnf(request, logger) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);\r\n const reqCnf = await invokeAsync(this.generateKid.bind(this), PerformanceEvents.PopTokenGenerateCnf, logger, this.performanceClient, request.correlationId)(request);\r\n const reqCnfString = this.cryptoUtils.base64UrlEncode(JSON.stringify(reqCnf));\r\n return {\r\n kid: reqCnf.kid,\r\n reqCnfString,\r\n };\r\n }\r\n /**\r\n * Generates key_id for a SHR token request\r\n * @param request\r\n * @returns\r\n */\r\n async generateKid(request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);\r\n const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);\r\n return {\r\n kid: kidThumbprint,\r\n xms_ksl: KeyLocation.SW,\r\n };\r\n }\r\n /**\r\n * Signs the POP access_token with the local generated key-pair\r\n * @param accessToken\r\n * @param request\r\n * @returns\r\n */\r\n async signPopToken(accessToken, keyId, request) {\r\n return this.signPayload(accessToken, keyId, request);\r\n }\r\n /**\r\n * Utility function to generate the signed JWT for an access_token\r\n * @param payload\r\n * @param kid\r\n * @param request\r\n * @param claims\r\n * @returns\r\n */\r\n async signPayload(payload, keyId, request, claims) {\r\n // Deconstruct request to extract SHR parameters\r\n const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, shrOptions, } = request;\r\n const resourceUrlString = resourceRequestUri\r\n ? new UrlString(resourceRequestUri)\r\n : undefined;\r\n const resourceUrlComponents = resourceUrlString?.getUrlComponents();\r\n return this.cryptoUtils.signJwt({\r\n at: payload,\r\n ts: nowSeconds(),\r\n m: resourceRequestMethod?.toUpperCase(),\r\n u: resourceUrlComponents?.HostNameAndPort,\r\n nonce: shrNonce || this.cryptoUtils.createNewGuid(),\r\n p: resourceUrlComponents?.AbsolutePath,\r\n q: resourceUrlComponents?.QueryString\r\n ? [[], resourceUrlComponents.QueryString]\r\n : undefined,\r\n client_claims: shrClaims || undefined,\r\n ...claims,\r\n }, keyId, shrOptions, request.correlationId);\r\n }\r\n}\n\nexport { PopTokenGenerator };\n//# sourceMappingURL=PopTokenGenerator.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class instance helps track the memory changes facilitating\r\n * decisions to read from and write to the persistent cache\r\n */ class TokenCacheContext {\r\n constructor(tokenCache, hasChanged) {\r\n this.cache = tokenCache;\r\n this.hasChanged = hasChanged;\r\n }\r\n /**\r\n * boolean which indicates the changes in cache\r\n */\r\n get cacheHasChanged() {\r\n return this.hasChanged;\r\n }\r\n /**\r\n * function to retrieve the token cache\r\n */\r\n get tokenCache() {\r\n return this.cache;\r\n }\r\n}\n\nexport { TokenCacheContext };\n//# sourceMappingURL=TokenCacheContext.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { ServerError } from '../error/ServerError.mjs';\nimport { ScopeSet } from '../request/ScopeSet.mjs';\nimport { AccountEntity } from '../cache/entities/AccountEntity.mjs';\nimport { isInteractionRequiredError, InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.mjs';\nimport { ProtocolUtils } from '../utils/ProtocolUtils.mjs';\nimport { HttpStatus, Constants, AuthenticationScheme, THE_FAMILY_ID } from '../utils/Constants.mjs';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.mjs';\nimport { TokenCacheContext } from '../cache/persistence/TokenCacheContext.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { extractTokenClaims, checkMaxAge } from '../account/AuthToken.mjs';\nimport { getTenantIdFromIdTokenClaims } from '../account/TokenClaims.mjs';\nimport { updateAccountTenantProfileData, buildTenantProfile } from '../account/AccountInfo.mjs';\nimport { createAccessTokenEntity, createRefreshTokenEntity, createIdTokenEntity } from '../cache/utils/CacheHelpers.mjs';\nimport { toDateFromSeconds } from '../utils/TimeUtils.mjs';\nimport { nonceMismatch, authTimeNotFound, invalidCacheEnvironment, keyIdMissing } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Class that handles response parsing.\r\n * @internal\r\n */\r\nclass ResponseHandler {\r\n constructor(clientId, cacheStorage, cryptoObj, logger, serializableCache, persistencePlugin, performanceClient) {\r\n this.clientId = clientId;\r\n this.cacheStorage = cacheStorage;\r\n this.cryptoObj = cryptoObj;\r\n this.logger = logger;\r\n this.serializableCache = serializableCache;\r\n this.persistencePlugin = persistencePlugin;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Function which validates server authorization token response.\r\n * @param serverResponse\r\n * @param refreshAccessToken\r\n */\r\n validateTokenResponse(serverResponse, refreshAccessToken) {\r\n // Check for error\r\n if (serverResponse.error ||\r\n serverResponse.error_description ||\r\n serverResponse.suberror) {\r\n const errString = `Error(s): ${serverResponse.error_codes || Constants.NOT_AVAILABLE} - Timestamp: ${serverResponse.timestamp || Constants.NOT_AVAILABLE} - Description: ${serverResponse.error_description || Constants.NOT_AVAILABLE} - Correlation ID: ${serverResponse.correlation_id || Constants.NOT_AVAILABLE} - Trace ID: ${serverResponse.trace_id || Constants.NOT_AVAILABLE}`;\r\n const serverErrorNo = serverResponse.error_codes?.length\r\n ? serverResponse.error_codes[0]\r\n : undefined;\r\n const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo, serverResponse.status);\r\n // check if 500 error\r\n if (refreshAccessToken &&\r\n serverResponse.status &&\r\n serverResponse.status >= HttpStatus.SERVER_ERROR_RANGE_START &&\r\n serverResponse.status <= HttpStatus.SERVER_ERROR_RANGE_END) {\r\n this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\\n${serverError}`);\r\n // don't throw an exception, but alert the user via a log that the token was unable to be refreshed\r\n return;\r\n // check if 400 error\r\n }\r\n else if (refreshAccessToken &&\r\n serverResponse.status &&\r\n serverResponse.status >= HttpStatus.CLIENT_ERROR_RANGE_START &&\r\n serverResponse.status <= HttpStatus.CLIENT_ERROR_RANGE_END) {\r\n this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\\n${serverError}`);\r\n // don't throw an exception, but alert the user via a log that the token was unable to be refreshed\r\n return;\r\n }\r\n if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\r\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING, serverErrorNo);\r\n }\r\n throw serverError;\r\n }\r\n }\r\n /**\r\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\r\n * @param serverTokenResponse\r\n * @param authority\r\n */\r\n async handleServerTokenResponse(serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);\r\n // create an idToken object (not entity)\r\n let idTokenClaims;\r\n if (serverTokenResponse.id_token) {\r\n idTokenClaims = extractTokenClaims(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj.base64Decode);\r\n // token nonce check (TODO: Add a warning if no nonce is given?)\r\n if (authCodePayload && authCodePayload.nonce) {\r\n if (idTokenClaims.nonce !== authCodePayload.nonce) {\r\n throw createClientAuthError(nonceMismatch);\r\n }\r\n }\r\n // token max_age check\r\n if (request.maxAge || request.maxAge === 0) {\r\n const authTime = idTokenClaims.auth_time;\r\n if (!authTime) {\r\n throw createClientAuthError(authTimeNotFound);\r\n }\r\n checkMaxAge(authTime, request.maxAge);\r\n }\r\n }\r\n // generate homeAccountId\r\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);\r\n // save the response tokens\r\n let requestStateObj;\r\n if (!!authCodePayload && !!authCodePayload.state) {\r\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\r\n }\r\n // Add keyId from request to serverTokenResponse if defined\r\n serverTokenResponse.key_id =\r\n serverTokenResponse.key_id || request.sshKid || undefined;\r\n const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload);\r\n let cacheContext;\r\n try {\r\n if (this.persistencePlugin && this.serializableCache) {\r\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\r\n cacheContext = new TokenCacheContext(this.serializableCache, true);\r\n await this.persistencePlugin.beforeCacheAccess(cacheContext);\r\n }\r\n /*\r\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\r\n * If not present, we should return null, as it's the case that another application called removeAccount in between\r\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by\r\n * the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.\r\n */\r\n if (handlingRefreshTokenResponse &&\r\n !forceCacheRefreshTokenResponse &&\r\n cacheRecord.account) {\r\n const key = cacheRecord.account.generateAccountKey();\r\n const account = this.cacheStorage.getAccount(key);\r\n if (!account) {\r\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\r\n return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);\r\n }\r\n }\r\n await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, request.storeInCache);\r\n }\r\n finally {\r\n if (this.persistencePlugin &&\r\n this.serializableCache &&\r\n cacheContext) {\r\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\r\n await this.persistencePlugin.afterCacheAccess(cacheContext);\r\n }\r\n }\r\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, serverTokenResponse, serverRequestId);\r\n }\r\n /**\r\n * Generates CacheRecord\r\n * @param serverTokenResponse\r\n * @param idTokenObj\r\n * @param authority\r\n */\r\n generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenClaims, userAssertionHash, authCodePayload) {\r\n const env = authority.getPreferredCache();\r\n if (!env) {\r\n throw createClientAuthError(invalidCacheEnvironment);\r\n }\r\n const claimsTenantId = getTenantIdFromIdTokenClaims(idTokenClaims);\r\n // IdToken: non AAD scenarios can have empty realm\r\n let cachedIdToken;\r\n let cachedAccount;\r\n if (serverTokenResponse.id_token && !!idTokenClaims) {\r\n cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || \"\");\r\n cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId\r\n this.logger);\r\n }\r\n // AccessToken\r\n let cachedAccessToken = null;\r\n if (serverTokenResponse.access_token) {\r\n // If scopes not returned in server response, use request scopes\r\n const responseScopes = serverTokenResponse.scope\r\n ? ScopeSet.fromString(serverTokenResponse.scope)\r\n : new ScopeSet(request.scopes || []);\r\n /*\r\n * Use timestamp calculated before request\r\n * Server may return timestamps as strings, parse to numbers if so.\r\n */\r\n const expiresIn = (typeof serverTokenResponse.expires_in === \"string\"\r\n ? parseInt(serverTokenResponse.expires_in, 10)\r\n : serverTokenResponse.expires_in) || 0;\r\n const extExpiresIn = (typeof serverTokenResponse.ext_expires_in === \"string\"\r\n ? parseInt(serverTokenResponse.ext_expires_in, 10)\r\n : serverTokenResponse.ext_expires_in) || 0;\r\n const refreshIn = (typeof serverTokenResponse.refresh_in === \"string\"\r\n ? parseInt(serverTokenResponse.refresh_in, 10)\r\n : serverTokenResponse.refresh_in) || undefined;\r\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\r\n const extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\r\n const refreshOnSeconds = refreshIn && refreshIn > 0\r\n ? reqTimestamp + refreshIn\r\n : undefined;\r\n // non AAD scenarios can have empty realm\r\n cachedAccessToken = createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token, this.clientId, claimsTenantId || authority.tenant || \"\", responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj.base64Decode, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);\r\n }\r\n // refreshToken\r\n let cachedRefreshToken = null;\r\n if (serverTokenResponse.refresh_token) {\r\n let rtExpiresOn;\r\n if (serverTokenResponse.refresh_token_expires_in) {\r\n const rtExpiresIn = typeof serverTokenResponse.refresh_token_expires_in ===\r\n \"string\"\r\n ? parseInt(serverTokenResponse.refresh_token_expires_in, 10)\r\n : serverTokenResponse.refresh_token_expires_in;\r\n rtExpiresOn = reqTimestamp + rtExpiresIn;\r\n }\r\n cachedRefreshToken = createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token, this.clientId, serverTokenResponse.foci, userAssertionHash, rtExpiresOn);\r\n }\r\n // appMetadata\r\n let cachedAppMetadata = null;\r\n if (serverTokenResponse.foci) {\r\n cachedAppMetadata = {\r\n clientId: this.clientId,\r\n environment: env,\r\n familyId: serverTokenResponse.foci,\r\n };\r\n }\r\n return {\r\n account: cachedAccount,\r\n idToken: cachedIdToken,\r\n accessToken: cachedAccessToken,\r\n refreshToken: cachedRefreshToken,\r\n appMetadata: cachedAppMetadata,\r\n };\r\n }\r\n /**\r\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\r\n *\r\n * Optionally takes a state string that is set as-is in the response.\r\n *\r\n * @param cacheRecord\r\n * @param idTokenObj\r\n * @param fromTokenCache\r\n * @param stateString\r\n */\r\n static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, idTokenClaims, requestState, serverTokenResponse, requestId) {\r\n let accessToken = Constants.EMPTY_STRING;\r\n let responseScopes = [];\r\n let expiresOn = null;\r\n let extExpiresOn;\r\n let refreshOn;\r\n let familyId = Constants.EMPTY_STRING;\r\n if (cacheRecord.accessToken) {\r\n /*\r\n * if the request object has `popKid` property, `signPopToken` will be set to false and\r\n * the token will be returned unsigned\r\n */\r\n if (cacheRecord.accessToken.tokenType ===\r\n AuthenticationScheme.POP &&\r\n !request.popKid) {\r\n const popTokenGenerator = new PopTokenGenerator(cryptoObj);\r\n const { secret, keyId } = cacheRecord.accessToken;\r\n if (!keyId) {\r\n throw createClientAuthError(keyIdMissing);\r\n }\r\n accessToken = await popTokenGenerator.signPopToken(secret, keyId, request);\r\n }\r\n else {\r\n accessToken = cacheRecord.accessToken.secret;\r\n }\r\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\r\n // Access token expiresOn cached in seconds, converting to Date for AuthenticationResult\r\n expiresOn = toDateFromSeconds(cacheRecord.accessToken.expiresOn);\r\n extExpiresOn = toDateFromSeconds(cacheRecord.accessToken.extendedExpiresOn);\r\n if (cacheRecord.accessToken.refreshOn) {\r\n refreshOn = toDateFromSeconds(cacheRecord.accessToken.refreshOn);\r\n }\r\n }\r\n if (cacheRecord.appMetadata) {\r\n familyId =\r\n cacheRecord.appMetadata.familyId === THE_FAMILY_ID\r\n ? THE_FAMILY_ID\r\n : \"\";\r\n }\r\n const uid = idTokenClaims?.oid || idTokenClaims?.sub || \"\";\r\n const tid = idTokenClaims?.tid || \"\";\r\n // for hybrid + native bridge enablement, send back the native account Id\r\n if (serverTokenResponse?.spa_accountid && !!cacheRecord.account) {\r\n cacheRecord.account.nativeAccountId =\r\n serverTokenResponse?.spa_accountid;\r\n }\r\n const accountInfo = cacheRecord.account\r\n ? updateAccountTenantProfileData(cacheRecord.account.getAccountInfo(), undefined, // tenantProfile optional\r\n idTokenClaims, cacheRecord.idToken?.secret)\r\n : null;\r\n return {\r\n authority: authority.canonicalAuthority,\r\n uniqueId: uid,\r\n tenantId: tid,\r\n scopes: responseScopes,\r\n account: accountInfo,\r\n idToken: cacheRecord?.idToken?.secret || \"\",\r\n idTokenClaims: idTokenClaims || {},\r\n accessToken: accessToken,\r\n fromCache: fromTokenCache,\r\n expiresOn: expiresOn,\r\n extExpiresOn: extExpiresOn,\r\n refreshOn: refreshOn,\r\n correlationId: request.correlationId,\r\n requestId: requestId || Constants.EMPTY_STRING,\r\n familyId: familyId,\r\n tokenType: cacheRecord.accessToken?.tokenType || Constants.EMPTY_STRING,\r\n state: requestState\r\n ? requestState.userRequestState\r\n : Constants.EMPTY_STRING,\r\n cloudGraphHostName: cacheRecord.account?.cloudGraphHostName ||\r\n Constants.EMPTY_STRING,\r\n msGraphHost: cacheRecord.account?.msGraphHost || Constants.EMPTY_STRING,\r\n code: serverTokenResponse?.spa_code,\r\n fromNativeBroker: false,\r\n };\r\n }\r\n}\r\nfunction buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {\r\n logger?.verbose(\"setCachedAccount called\");\r\n // Check if base account is already cached\r\n const accountKeys = cacheStorage.getAccountKeys();\r\n const baseAccountKey = accountKeys.find((accountKey) => {\r\n return accountKey.startsWith(homeAccountId);\r\n });\r\n let cachedAccount = null;\r\n if (baseAccountKey) {\r\n cachedAccount = cacheStorage.getAccount(baseAccountKey);\r\n }\r\n const baseAccount = cachedAccount ||\r\n AccountEntity.createAccount({\r\n homeAccountId,\r\n idTokenClaims,\r\n clientInfo,\r\n environment,\r\n cloudGraphHostName: authCodePayload?.cloud_graph_host_name,\r\n msGraphHost: authCodePayload?.msgraph_host,\r\n nativeAccountId: nativeAccountId,\r\n }, authority, base64Decode);\r\n const tenantProfiles = baseAccount.tenantProfiles || [];\r\n const tenantId = claimsTenantId || baseAccount.realm;\r\n if (tenantId &&\r\n !tenantProfiles.find((tenantProfile) => {\r\n return tenantProfile.tenantId === tenantId;\r\n })) {\r\n const newTenantProfile = buildTenantProfile(homeAccountId, baseAccount.localAccountId, tenantId, idTokenClaims);\r\n tenantProfiles.push(newTenantProfile);\r\n }\r\n baseAccount.tenantProfiles = tenantProfiles;\r\n return baseAccount;\r\n}\n\nexport { ResponseHandler, buildAccountToCache };\n//# sourceMappingURL=ResponseHandler.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { CodeChallengeMethodValues, PromptValue } from '../utils/Constants.mjs';\nimport { redirectUriEmpty, invalidPromptValue, invalidClaims, pkceParamsMissing, invalidCodeChallengeMethod } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Validates server consumable params from the \"request\" objects\r\n */\r\nclass RequestValidator {\r\n /**\r\n * Utility to check if the `redirectUri` in the request is a non-null value\r\n * @param redirectUri\r\n */\r\n static validateRedirectUri(redirectUri) {\r\n if (!redirectUri) {\r\n throw createClientConfigurationError(redirectUriEmpty);\r\n }\r\n }\r\n /**\r\n * Utility to validate prompt sent by the user in the request\r\n * @param prompt\r\n */\r\n static validatePrompt(prompt) {\r\n const promptValues = [];\r\n for (const value in PromptValue) {\r\n promptValues.push(PromptValue[value]);\r\n }\r\n if (promptValues.indexOf(prompt) < 0) {\r\n throw createClientConfigurationError(invalidPromptValue);\r\n }\r\n }\r\n static validateClaims(claims) {\r\n try {\r\n JSON.parse(claims);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidClaims);\r\n }\r\n }\r\n /**\r\n * Utility to validate code_challenge and code_challenge_method\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n static validateCodeChallengeParams(codeChallenge, codeChallengeMethod) {\r\n if (!codeChallenge || !codeChallengeMethod) {\r\n throw createClientConfigurationError(pkceParamsMissing);\r\n }\r\n else {\r\n this.validateCodeChallengeMethod(codeChallengeMethod);\r\n }\r\n }\r\n /**\r\n * Utility to validate code_challenge_method\r\n * @param codeChallengeMethod\r\n */\r\n static validateCodeChallengeMethod(codeChallengeMethod) {\r\n if ([\r\n CodeChallengeMethodValues.PLAIN,\r\n CodeChallengeMethodValues.S256,\r\n ].indexOf(codeChallengeMethod) < 0) {\r\n throw createClientConfigurationError(invalidCodeChallengeMethod);\r\n }\r\n }\r\n}\n\nexport { RequestValidator };\n//# sourceMappingURL=RequestValidator.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nasync function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {\r\n if (typeof clientAssertion === \"string\") {\r\n return clientAssertion;\r\n }\r\n else {\r\n const config = {\r\n clientId: clientId,\r\n tokenEndpoint: tokenEndpoint,\r\n };\r\n return clientAssertion(config);\r\n }\r\n}\n\nexport { getClientAssertion };\n//# sourceMappingURL=ClientAssertionUtils.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { BaseClient } from './BaseClient.mjs';\nimport { addClientId, addRedirectUri, addScopes, addAuthorizationCode, addLibraryInfo, addApplicationTelemetry, addThrottling, addServerTelemetry, addCodeVerifier, addClientSecret, addClientAssertion, addClientAssertionType, addGrantType, addClientInfo, addPopToken, addSshJwk, addClaims, addCcsUpn, addCcsOid, addBrokerParameters, addExtraQueryParameters, instrumentBrokerParams, addPostLogoutRedirectUri, addCorrelationId, addIdTokenHint, addState, addLogoutHint, addInstanceAware } from '../request/RequestParameterBuilder.mjs';\nimport { mapToQueryString } from '../utils/UrlUtils.mjs';\nimport { Separators, GrantType, AuthenticationScheme, HeaderNames } from '../utils/Constants.mjs';\nimport { CLIENT_ID, RETURN_SPA_CODE } from '../constants/AADServerParamKeys.mjs';\nimport { isOidcProtocolMode } from '../config/ClientConfiguration.mjs';\nimport { ResponseHandler } from '../response/ResponseHandler.mjs';\nimport { StringUtils } from '../utils/StringUtils.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.mjs';\nimport { nowSeconds } from '../utils/TimeUtils.mjs';\nimport { buildClientInfo, buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';\nimport { CcsCredentialType } from '../account/CcsCredential.mjs';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { RequestValidator } from '../request/RequestValidator.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { getClientAssertion } from '../utils/ClientAssertionUtils.mjs';\nimport { getRequestThumbprint } from '../network/RequestThumbprint.mjs';\nimport { requestCannotBeMade } from '../error/ClientAuthErrorCodes.mjs';\nimport { logoutRequestEmpty, missingSshJwk } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Oauth2.0 Authorization Code client\r\n * @internal\r\n */\r\nclass AuthorizationCodeClient extends BaseClient {\r\n constructor(configuration, performanceClient) {\r\n super(configuration, performanceClient);\r\n // Flag to indicate if client is for hybrid spa auth code redemption\r\n this.includeRedirectUri = true;\r\n this.oidcDefaultScopes =\r\n this.config.authOptions.authority.options.OIDCOptions?.defaultScopes;\r\n }\r\n /**\r\n * API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the\r\n * authorization_code_grant\r\n * @param request\r\n */\r\n async acquireToken(request, authCodePayload) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);\r\n if (!request.code) {\r\n throw createClientAuthError(requestCannotBeMade);\r\n }\r\n const reqTimestamp = nowSeconds();\r\n const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request);\r\n // Retrieve requestId from response headers\r\n const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];\r\n const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);\r\n // Validate response. This function throws a server error if an error is returned by the server.\r\n responseHandler.validateTokenResponse(response.body);\r\n return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId);\r\n }\r\n /**\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param authorityUri\r\n */\r\n getLogoutUri(logoutRequest) {\r\n // Throw error if logoutRequest is null/undefined\r\n if (!logoutRequest) {\r\n throw createClientConfigurationError(logoutRequestEmpty);\r\n }\r\n const queryString = this.createLogoutUrlQueryString(logoutRequest);\r\n // Construct logout URI\r\n return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);\r\n }\r\n /**\r\n * Executes POST request to token endpoint\r\n * @param authority\r\n * @param request\r\n */\r\n async executeTokenRequest(authority, request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);\r\n const queryParametersString = this.createTokenQueryParameters(request);\r\n const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\r\n const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), PerformanceEvents.AuthClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);\r\n let ccsCredential = undefined;\r\n if (request.clientInfo) {\r\n try {\r\n const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils.base64Decode);\r\n ccsCredential = {\r\n credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID,\r\n };\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\r\n }\r\n }\r\n const headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);\r\n const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);\r\n return invokeAsync(this.executePostToTokenEndpoint.bind(this), PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint);\r\n }\r\n /**\r\n * Generates a map for all the params to be sent to the service\r\n * @param request\r\n */\r\n async createTokenRequestBody(request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);\r\n const parameters = new Map();\r\n addClientId(parameters, request.embeddedClientId ||\r\n request.tokenBodyParameters?.[CLIENT_ID] ||\r\n this.config.authOptions.clientId);\r\n /*\r\n * For hybrid spa flow, there will be a code but no verifier\r\n * In this scenario, don't include redirect uri as auth code will not be bound to redirect URI\r\n */\r\n if (!this.includeRedirectUri) {\r\n // Just validate\r\n RequestValidator.validateRedirectUri(request.redirectUri);\r\n }\r\n else {\r\n // Validate and include redirect uri\r\n addRedirectUri(parameters, request.redirectUri);\r\n }\r\n // Add scope array, parameter builder will add default scopes and dedupe\r\n addScopes(parameters, request.scopes, true, this.oidcDefaultScopes);\r\n // add code: user set, not validated\r\n addAuthorizationCode(parameters, request.code);\r\n // Add library metadata\r\n addLibraryInfo(parameters, this.config.libraryInfo);\r\n addApplicationTelemetry(parameters, this.config.telemetry.application);\r\n addThrottling(parameters);\r\n if (this.serverTelemetryManager && !isOidcProtocolMode(this.config)) {\r\n addServerTelemetry(parameters, this.serverTelemetryManager);\r\n }\r\n // add code_verifier if passed\r\n if (request.codeVerifier) {\r\n addCodeVerifier(parameters, request.codeVerifier);\r\n }\r\n if (this.config.clientCredentials.clientSecret) {\r\n addClientSecret(parameters, this.config.clientCredentials.clientSecret);\r\n }\r\n if (this.config.clientCredentials.clientAssertion) {\r\n const clientAssertion = this.config.clientCredentials.clientAssertion;\r\n addClientAssertion(parameters, await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));\r\n addClientAssertionType(parameters, clientAssertion.assertionType);\r\n }\r\n addGrantType(parameters, GrantType.AUTHORIZATION_CODE_GRANT);\r\n addClientInfo(parameters);\r\n if (request.authenticationScheme === AuthenticationScheme.POP) {\r\n const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);\r\n let reqCnfData;\r\n if (!request.popKid) {\r\n const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);\r\n reqCnfData = generatedReqCnfData.reqCnfString;\r\n }\r\n else {\r\n reqCnfData = this.cryptoUtils.encodeKid(request.popKid);\r\n }\r\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\r\n addPopToken(parameters, reqCnfData);\r\n }\r\n else if (request.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (request.sshJwk) {\r\n addSshJwk(parameters, request.sshJwk);\r\n }\r\n else {\r\n throw createClientConfigurationError(missingSshJwk);\r\n }\r\n }\r\n if (!StringUtils.isEmptyObj(request.claims) ||\r\n (this.config.authOptions.clientCapabilities &&\r\n this.config.authOptions.clientCapabilities.length > 0)) {\r\n addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n let ccsCred = undefined;\r\n if (request.clientInfo) {\r\n try {\r\n const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils.base64Decode);\r\n ccsCred = {\r\n credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID,\r\n };\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\r\n }\r\n }\r\n else {\r\n ccsCred = request.ccsCredential;\r\n }\r\n // Adds these as parameters in the request instead of headers to prevent CORS preflight request\r\n if (this.config.systemOptions.preventCorsPreflight && ccsCred) {\r\n switch (ccsCred.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\r\n addCcsOid(parameters, clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" +\r\n e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n addCcsUpn(parameters, ccsCred.credential);\r\n break;\r\n }\r\n }\r\n if (request.embeddedClientId) {\r\n addBrokerParameters(parameters, this.config.authOptions.clientId, this.config.authOptions.redirectUri);\r\n }\r\n if (request.tokenBodyParameters) {\r\n addExtraQueryParameters(parameters, request.tokenBodyParameters);\r\n }\r\n // Add hybrid spa parameters if not already provided\r\n if (request.enableSpaAuthorizationCode &&\r\n (!request.tokenBodyParameters ||\r\n !request.tokenBodyParameters[RETURN_SPA_CODE])) {\r\n addExtraQueryParameters(parameters, {\r\n [RETURN_SPA_CODE]: \"1\",\r\n });\r\n }\r\n instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);\r\n return mapToQueryString(parameters);\r\n }\r\n /**\r\n * This API validates the `EndSessionRequest` and creates a URL\r\n * @param request\r\n */\r\n createLogoutUrlQueryString(request) {\r\n const parameters = new Map();\r\n if (request.postLogoutRedirectUri) {\r\n addPostLogoutRedirectUri(parameters, request.postLogoutRedirectUri);\r\n }\r\n if (request.correlationId) {\r\n addCorrelationId(parameters, request.correlationId);\r\n }\r\n if (request.idTokenHint) {\r\n addIdTokenHint(parameters, request.idTokenHint);\r\n }\r\n if (request.state) {\r\n addState(parameters, request.state);\r\n }\r\n if (request.logoutHint) {\r\n addLogoutHint(parameters, request.logoutHint);\r\n }\r\n if (request.extraQueryParameters) {\r\n addExtraQueryParameters(parameters, request.extraQueryParameters);\r\n }\r\n if (this.config.authOptions.instanceAware) {\r\n addInstanceAware(parameters);\r\n }\r\n return mapToQueryString(parameters);\r\n }\r\n}\n\nexport { AuthorizationCodeClient };\n//# sourceMappingURL=AuthorizationCodeClient.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { isOidcProtocolMode } from '../config/ClientConfiguration.mjs';\nimport { BaseClient } from './BaseClient.mjs';\nimport { addClientId, addRedirectUri, addScopes, addGrantType, addClientInfo, addLibraryInfo, addApplicationTelemetry, addThrottling, addServerTelemetry, addRefreshToken, addClientSecret, addClientAssertion, addClientAssertionType, addPopToken, addSshJwk, addClaims, addCcsUpn, addCcsOid, addBrokerParameters, addExtraQueryParameters, instrumentBrokerParams } from '../request/RequestParameterBuilder.mjs';\nimport { mapToQueryString } from '../utils/UrlUtils.mjs';\nimport { GrantType, AuthenticationScheme, HeaderNames, Errors } from '../utils/Constants.mjs';\nimport { CLIENT_ID } from '../constants/AADServerParamKeys.mjs';\nimport { ResponseHandler } from '../response/ResponseHandler.mjs';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.mjs';\nimport { StringUtils } from '../utils/StringUtils.mjs';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { ServerError } from '../error/ServerError.mjs';\nimport { nowSeconds, isTokenExpired } from '../utils/TimeUtils.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { CcsCredentialType } from '../account/CcsCredential.mjs';\nimport { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';\nimport { createInteractionRequiredAuthError, InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync, invoke } from '../utils/FunctionWrappers.mjs';\nimport { generateCredentialKey } from '../cache/utils/CacheHelpers.mjs';\nimport { getClientAssertion } from '../utils/ClientAssertionUtils.mjs';\nimport { getRequestThumbprint } from '../network/RequestThumbprint.mjs';\nimport { tokenRequestEmpty, missingSshJwk } from '../error/ClientConfigurationErrorCodes.mjs';\nimport { noAccountInSilentRequest } from '../error/ClientAuthErrorCodes.mjs';\nimport { noTokensFound, refreshTokenExpired, badToken } from '../error/InteractionRequiredAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS = 300; // 5 Minutes\r\n/**\r\n * OAuth2.0 refresh token client\r\n * @internal\r\n */\r\nclass RefreshTokenClient extends BaseClient {\r\n constructor(configuration, performanceClient) {\r\n super(configuration, performanceClient);\r\n }\r\n async acquireToken(request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);\r\n const reqTimestamp = nowSeconds();\r\n const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);\r\n // Retrieve requestId from response headers\r\n const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];\r\n const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);\r\n responseHandler.validateTokenResponse(response.body);\r\n return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId);\r\n }\r\n /**\r\n * Gets cached refresh token and attaches to request, then calls acquireToken API\r\n * @param request\r\n */\r\n async acquireTokenByRefreshToken(request) {\r\n // Cannot renew token if no request object is given.\r\n if (!request) {\r\n throw createClientConfigurationError(tokenRequestEmpty);\r\n }\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);\r\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\r\n if (!request.account) {\r\n throw createClientAuthError(noAccountInSilentRequest);\r\n }\r\n // try checking if FOCI is enabled for the given application\r\n const isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);\r\n // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest\r\n if (isFOCI) {\r\n try {\r\n return await invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, true);\r\n }\r\n catch (e) {\r\n const noFamilyRTInCache = e instanceof InteractionRequiredAuthError &&\r\n e.errorCode ===\r\n noTokensFound;\r\n const clientMismatchErrorWithFamilyRT = e instanceof ServerError &&\r\n e.errorCode === Errors.INVALID_GRANT_ERROR &&\r\n e.subError === Errors.CLIENT_MISMATCH_ERROR;\r\n // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)\r\n if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {\r\n return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);\r\n // throw in all other cases\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n }\r\n // fall back to application refresh token acquisition\r\n return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);\r\n }\r\n /**\r\n * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached\r\n * @param request\r\n */\r\n async acquireTokenWithCachedRefreshToken(request, foci) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n // fetches family RT or application RT based on FOCI value\r\n const refreshToken = invoke(this.cacheManager.getRefreshToken.bind(this.cacheManager), PerformanceEvents.CacheManagerGetRefreshToken, this.logger, this.performanceClient, request.correlationId)(request.account, foci, undefined, this.performanceClient, request.correlationId);\r\n if (!refreshToken) {\r\n throw createInteractionRequiredAuthError(noTokensFound);\r\n }\r\n if (refreshToken.expiresOn &&\r\n isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||\r\n DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {\r\n this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);\r\n throw createInteractionRequiredAuthError(refreshTokenExpired);\r\n }\r\n // attach cached RT size to the current measurement\r\n const refreshTokenRequest = {\r\n ...request,\r\n refreshToken: refreshToken.secret,\r\n authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,\r\n ccsCredential: {\r\n credential: request.account.homeAccountId,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID,\r\n },\r\n };\r\n try {\r\n return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);\r\n }\r\n catch (e) {\r\n if (e instanceof InteractionRequiredAuthError) {\r\n this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);\r\n if (e.subError === badToken) {\r\n // Remove bad refresh token from cache\r\n this.logger.verbose(\"acquireTokenWithRefreshToken: bad refresh token, removing from cache\");\r\n const badRefreshTokenKey = generateCredentialKey(refreshToken);\r\n this.cacheManager.removeRefreshToken(badRefreshTokenKey);\r\n }\r\n }\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Constructs the network message and makes a NW call to the underlying secure token service\r\n * @param request\r\n * @param authority\r\n */\r\n async executeTokenRequest(request, authority) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);\r\n const queryParametersString = this.createTokenQueryParameters(request);\r\n const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\r\n const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);\r\n const headers = this.createTokenRequestHeaders(request.ccsCredential);\r\n const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);\r\n return invokeAsync(this.executePostToTokenEndpoint.bind(this), PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint);\r\n }\r\n /**\r\n * Helper function to create the token request body\r\n * @param request\r\n */\r\n async createTokenRequestBody(request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);\r\n const parameters = new Map();\r\n addClientId(parameters, request.embeddedClientId ||\r\n request.tokenBodyParameters?.[CLIENT_ID] ||\r\n this.config.authOptions.clientId);\r\n if (request.redirectUri) {\r\n addRedirectUri(parameters, request.redirectUri);\r\n }\r\n addScopes(parameters, request.scopes, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);\r\n addGrantType(parameters, GrantType.REFRESH_TOKEN_GRANT);\r\n addClientInfo(parameters);\r\n addLibraryInfo(parameters, this.config.libraryInfo);\r\n addApplicationTelemetry(parameters, this.config.telemetry.application);\r\n addThrottling(parameters);\r\n if (this.serverTelemetryManager && !isOidcProtocolMode(this.config)) {\r\n addServerTelemetry(parameters, this.serverTelemetryManager);\r\n }\r\n addRefreshToken(parameters, request.refreshToken);\r\n if (this.config.clientCredentials.clientSecret) {\r\n addClientSecret(parameters, this.config.clientCredentials.clientSecret);\r\n }\r\n if (this.config.clientCredentials.clientAssertion) {\r\n const clientAssertion = this.config.clientCredentials.clientAssertion;\r\n addClientAssertion(parameters, await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));\r\n addClientAssertionType(parameters, clientAssertion.assertionType);\r\n }\r\n if (request.authenticationScheme === AuthenticationScheme.POP) {\r\n const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);\r\n let reqCnfData;\r\n if (!request.popKid) {\r\n const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);\r\n reqCnfData = generatedReqCnfData.reqCnfString;\r\n }\r\n else {\r\n reqCnfData = this.cryptoUtils.encodeKid(request.popKid);\r\n }\r\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\r\n addPopToken(parameters, reqCnfData);\r\n }\r\n else if (request.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (request.sshJwk) {\r\n addSshJwk(parameters, request.sshJwk);\r\n }\r\n else {\r\n throw createClientConfigurationError(missingSshJwk);\r\n }\r\n }\r\n if (!StringUtils.isEmptyObj(request.claims) ||\r\n (this.config.authOptions.clientCapabilities &&\r\n this.config.authOptions.clientCapabilities.length > 0)) {\r\n addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n if (this.config.systemOptions.preventCorsPreflight &&\r\n request.ccsCredential) {\r\n switch (request.ccsCredential.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);\r\n addCcsOid(parameters, clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" +\r\n e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n addCcsUpn(parameters, request.ccsCredential.credential);\r\n break;\r\n }\r\n }\r\n if (request.embeddedClientId) {\r\n addBrokerParameters(parameters, this.config.authOptions.clientId, this.config.authOptions.redirectUri);\r\n }\r\n if (request.tokenBodyParameters) {\r\n addExtraQueryParameters(parameters, request.tokenBodyParameters);\r\n }\r\n instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);\r\n return mapToQueryString(parameters);\r\n }\r\n}\n\nexport { RefreshTokenClient };\n//# sourceMappingURL=RefreshTokenClient.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { BaseClient } from './BaseClient.mjs';\nimport { wasClockTurnedBack, isTokenExpired } from '../utils/TimeUtils.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { ResponseHandler } from '../response/ResponseHandler.mjs';\nimport { CacheOutcome } from '../utils/Constants.mjs';\nimport { StringUtils } from '../utils/StringUtils.mjs';\nimport { extractTokenClaims, checkMaxAge } from '../account/AuthToken.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { getTenantFromAuthorityString } from '../authority/Authority.mjs';\nimport { tokenRefreshRequired, noAccountInSilentRequest, authTimeNotFound } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/** @internal */\r\nclass SilentFlowClient extends BaseClient {\r\n constructor(configuration, performanceClient) {\r\n super(configuration, performanceClient);\r\n }\r\n /**\r\n * Retrieves token from cache or throws an error if it must be refreshed.\r\n * @param request\r\n */\r\n async acquireCachedToken(request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.SilentFlowClientAcquireCachedToken, request.correlationId);\r\n let lastCacheOutcome = CacheOutcome.NOT_APPLICABLE;\r\n if (request.forceRefresh ||\r\n (!this.config.cacheOptions.claimsBasedCachingEnabled &&\r\n !StringUtils.isEmptyObj(request.claims))) {\r\n // Must refresh due to present force_refresh flag.\r\n this.setCacheOutcome(CacheOutcome.FORCE_REFRESH_OR_CLAIMS, request.correlationId);\r\n throw createClientAuthError(tokenRefreshRequired);\r\n }\r\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\r\n if (!request.account) {\r\n throw createClientAuthError(noAccountInSilentRequest);\r\n }\r\n const requestTenantId = request.account.tenantId ||\r\n getTenantFromAuthorityString(request.authority);\r\n const tokenKeys = this.cacheManager.getTokenKeys();\r\n const cachedAccessToken = this.cacheManager.getAccessToken(request.account, request, tokenKeys, requestTenantId, this.performanceClient, request.correlationId);\r\n if (!cachedAccessToken) {\r\n // must refresh due to non-existent access_token\r\n this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);\r\n throw createClientAuthError(tokenRefreshRequired);\r\n }\r\n else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||\r\n isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {\r\n // must refresh due to the expires_in value\r\n this.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED, request.correlationId);\r\n throw createClientAuthError(tokenRefreshRequired);\r\n }\r\n else if (cachedAccessToken.refreshOn &&\r\n isTokenExpired(cachedAccessToken.refreshOn, 0)) {\r\n // must refresh (in the background) due to the refresh_in value\r\n lastCacheOutcome = CacheOutcome.PROACTIVELY_REFRESHED;\r\n // don't throw ClientAuthError.createRefreshRequiredError(), return cached token instead\r\n }\r\n const environment = request.authority || this.authority.getPreferredCache();\r\n const cacheRecord = {\r\n account: this.cacheManager.readAccountFromCache(request.account),\r\n accessToken: cachedAccessToken,\r\n idToken: this.cacheManager.getIdToken(request.account, tokenKeys, requestTenantId, this.performanceClient, request.correlationId),\r\n refreshToken: null,\r\n appMetadata: this.cacheManager.readAppMetadataFromCache(environment),\r\n };\r\n this.setCacheOutcome(lastCacheOutcome, request.correlationId);\r\n if (this.config.serverTelemetryManager) {\r\n this.config.serverTelemetryManager.incrementCacheHits();\r\n }\r\n return [\r\n await invokeAsync(this.generateResultFromCacheRecord.bind(this), PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord, this.logger, this.performanceClient, request.correlationId)(cacheRecord, request),\r\n lastCacheOutcome,\r\n ];\r\n }\r\n setCacheOutcome(cacheOutcome, correlationId) {\r\n this.serverTelemetryManager?.setCacheOutcome(cacheOutcome);\r\n this.performanceClient?.addFields({\r\n cacheOutcome: cacheOutcome,\r\n }, correlationId);\r\n if (cacheOutcome !== CacheOutcome.NOT_APPLICABLE) {\r\n this.logger.info(`Token refresh is required due to cache outcome: ${cacheOutcome}`);\r\n }\r\n }\r\n /**\r\n * Helper function to build response object from the CacheRecord\r\n * @param cacheRecord\r\n */\r\n async generateResultFromCacheRecord(cacheRecord, request) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord, request.correlationId);\r\n let idTokenClaims;\r\n if (cacheRecord.idToken) {\r\n idTokenClaims = extractTokenClaims(cacheRecord.idToken.secret, this.config.cryptoInterface.base64Decode);\r\n }\r\n // token max_age check\r\n if (request.maxAge || request.maxAge === 0) {\r\n const authTime = idTokenClaims?.auth_time;\r\n if (!authTime) {\r\n throw createClientAuthError(authTimeNotFound);\r\n }\r\n checkMaxAge(authTime, request.maxAge);\r\n }\r\n return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, idTokenClaims);\r\n }\r\n}\n\nexport { SilentFlowClient };\n//# sourceMappingURL=SilentFlowClient.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst StubbedNetworkModule = {\r\n sendGetRequestAsync: () => {\r\n return Promise.reject(createClientAuthError(methodNotImplemented));\r\n },\r\n sendPostRequestAsync: () => {\r\n return Promise.reject(createClientAuthError(methodNotImplemented));\r\n },\r\n};\n\nexport { StubbedNetworkModule };\n//# sourceMappingURL=INetworkModule.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { addClientId, addScopes, addRedirectUri, addCorrelationId, addResponseMode, addClientInfo, addPrompt, addDomainHint, addSid, addLoginHint, addCcsOid, addCcsUpn, addNonce, addState, addClaims, addBrokerParameters, addExtraQueryParameters, addInstanceAware } from '../request/RequestParameterBuilder.mjs';\nimport { CLIENT_ID } from '../constants/AADServerParamKeys.mjs';\nimport { PromptValue } from '../utils/Constants.mjs';\nimport { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';\nimport { mapToQueryString } from '../utils/UrlUtils.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { isInteractionRequiredError, InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.mjs';\nimport { ServerError } from '../error/ServerError.mjs';\nimport { authorizationCodeMissingFromServerResponse, stateNotFound, invalidState, stateMismatch } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR\r\n * @param config\r\n * @param request\r\n * @param logger\r\n * @param performanceClient\r\n * @returns\r\n */\r\nfunction getStandardAuthorizeRequestParameters(authOptions, request, logger, performanceClient) {\r\n // generate the correlationId if not set by the user and add\r\n const correlationId = request.correlationId;\r\n const parameters = new Map();\r\n addClientId(parameters, request.embeddedClientId ||\r\n request.extraQueryParameters?.[CLIENT_ID] ||\r\n authOptions.clientId);\r\n const requestScopes = [\r\n ...(request.scopes || []),\r\n ...(request.extraScopesToConsent || []),\r\n ];\r\n addScopes(parameters, requestScopes, true, authOptions.authority.options.OIDCOptions?.defaultScopes);\r\n addRedirectUri(parameters, request.redirectUri);\r\n addCorrelationId(parameters, correlationId);\r\n // add response_mode. If not passed in it defaults to query.\r\n addResponseMode(parameters, request.responseMode);\r\n // add client_info=1\r\n addClientInfo(parameters);\r\n if (request.prompt) {\r\n addPrompt(parameters, request.prompt);\r\n performanceClient?.addFields({ prompt: request.prompt }, correlationId);\r\n }\r\n if (request.domainHint) {\r\n addDomainHint(parameters, request.domainHint);\r\n performanceClient?.addFields({ domainHintFromRequest: true }, correlationId);\r\n }\r\n // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object\r\n if (request.prompt !== PromptValue.SELECT_ACCOUNT) {\r\n // AAD will throw if prompt=select_account is passed with an account hint\r\n if (request.sid && request.prompt === PromptValue.NONE) {\r\n // SessionID is only used in silent calls\r\n logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from request\");\r\n addSid(parameters, request.sid);\r\n performanceClient?.addFields({ sidFromRequest: true }, correlationId);\r\n }\r\n else if (request.account) {\r\n const accountSid = extractAccountSid(request.account);\r\n let accountLoginHintClaim = extractLoginHint(request.account);\r\n if (accountLoginHintClaim && request.domainHint) {\r\n logger.warning(`AuthorizationCodeClient.createAuthCodeUrlQueryString: \"domainHint\" param is set, skipping opaque \"login_hint\" claim. Please consider not passing domainHint`);\r\n accountLoginHintClaim = null;\r\n }\r\n // If login_hint claim is present, use it over sid/username\r\n if (accountLoginHintClaim) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: login_hint claim present on account\");\r\n addLoginHint(parameters, accountLoginHintClaim);\r\n performanceClient?.addFields({ loginHintFromClaim: true }, correlationId);\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n addCcsOid(parameters, clientInfo);\r\n }\r\n catch (e) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n else if (accountSid && request.prompt === PromptValue.NONE) {\r\n /*\r\n * If account and loginHint are provided, we will check account first for sid before adding loginHint\r\n * SessionId is only used in silent calls\r\n */\r\n logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from account\");\r\n addSid(parameters, accountSid);\r\n performanceClient?.addFields({ sidFromClaim: true }, correlationId);\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n addCcsOid(parameters, clientInfo);\r\n }\r\n catch (e) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n else if (request.loginHint) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from request\");\r\n addLoginHint(parameters, request.loginHint);\r\n addCcsUpn(parameters, request.loginHint);\r\n performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);\r\n }\r\n else if (request.account.username) {\r\n // Fallback to account username if provided\r\n logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from account\");\r\n addLoginHint(parameters, request.account.username);\r\n performanceClient?.addFields({ loginHintFromUpn: true }, correlationId);\r\n try {\r\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n addCcsOid(parameters, clientInfo);\r\n }\r\n catch (e) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n }\r\n else if (request.loginHint) {\r\n logger.verbose(\"createAuthCodeUrlQueryString: No account, adding login_hint from request\");\r\n addLoginHint(parameters, request.loginHint);\r\n addCcsUpn(parameters, request.loginHint);\r\n performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);\r\n }\r\n }\r\n else {\r\n logger.verbose(\"createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints\");\r\n }\r\n if (request.nonce) {\r\n addNonce(parameters, request.nonce);\r\n }\r\n if (request.state) {\r\n addState(parameters, request.state);\r\n }\r\n if (request.claims ||\r\n (authOptions.clientCapabilities &&\r\n authOptions.clientCapabilities.length > 0)) {\r\n addClaims(parameters, request.claims, authOptions.clientCapabilities);\r\n }\r\n if (request.embeddedClientId) {\r\n addBrokerParameters(parameters, authOptions.clientId, authOptions.redirectUri);\r\n }\r\n if (request.extraQueryParameters) {\r\n addExtraQueryParameters(parameters, request.extraQueryParameters);\r\n }\r\n if (authOptions.instanceAware) {\r\n addInstanceAware(parameters);\r\n }\r\n return parameters;\r\n}\r\n/**\r\n * Returns authorize endpoint with given request parameters in the query string\r\n * @param authority\r\n * @param requestParameters\r\n * @returns\r\n */\r\nfunction getAuthorizeUrl(authority, requestParameters) {\r\n const queryString = mapToQueryString(requestParameters);\r\n return UrlString.appendQueryString(authority.authorizationEndpoint, queryString);\r\n}\r\n/**\r\n * Handles the hash fragment response from public client code request. Returns a code response used by\r\n * the client to exchange for a token in acquireToken.\r\n * @param serverParams\r\n * @param cachedState\r\n */\r\nfunction getAuthorizationCodePayload(serverParams, cachedState) {\r\n // Get code response\r\n validateAuthorizationResponse(serverParams, cachedState);\r\n // throw when there is no auth code in the response\r\n if (!serverParams.code) {\r\n throw createClientAuthError(authorizationCodeMissingFromServerResponse);\r\n }\r\n return serverParams;\r\n}\r\n/**\r\n * Function which validates server authorization code response.\r\n * @param serverResponseHash\r\n * @param requestState\r\n */\r\nfunction validateAuthorizationResponse(serverResponse, requestState) {\r\n if (!serverResponse.state || !requestState) {\r\n throw serverResponse.state\r\n ? createClientAuthError(stateNotFound, \"Cached State\")\r\n : createClientAuthError(stateNotFound, \"Server State\");\r\n }\r\n let decodedServerResponseState;\r\n let decodedRequestState;\r\n try {\r\n decodedServerResponseState = decodeURIComponent(serverResponse.state);\r\n }\r\n catch (e) {\r\n throw createClientAuthError(invalidState, serverResponse.state);\r\n }\r\n try {\r\n decodedRequestState = decodeURIComponent(requestState);\r\n }\r\n catch (e) {\r\n throw createClientAuthError(invalidState, serverResponse.state);\r\n }\r\n if (decodedServerResponseState !== decodedRequestState) {\r\n throw createClientAuthError(stateMismatch);\r\n }\r\n // Check for error\r\n if (serverResponse.error ||\r\n serverResponse.error_description ||\r\n serverResponse.suberror) {\r\n const serverErrorNo = parseServerErrorNo(serverResponse);\r\n if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\r\n throw new InteractionRequiredAuthError(serverResponse.error || \"\", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || \"\", serverResponse.trace_id || \"\", serverResponse.correlation_id || \"\", serverResponse.claims || \"\", serverErrorNo);\r\n }\r\n throw new ServerError(serverResponse.error || \"\", serverResponse.error_description, serverResponse.suberror, serverErrorNo);\r\n }\r\n}\r\n/**\r\n * Get server error No from the error_uri\r\n * @param serverResponse\r\n * @returns\r\n */\r\nfunction parseServerErrorNo(serverResponse) {\r\n const errorCodePrefix = \"code=\";\r\n const errorCodePrefixIndex = serverResponse.error_uri?.lastIndexOf(errorCodePrefix);\r\n return errorCodePrefixIndex && errorCodePrefixIndex >= 0\r\n ? serverResponse.error_uri?.substring(errorCodePrefixIndex + errorCodePrefix.length)\r\n : undefined;\r\n}\r\n/**\r\n * Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.\r\n * @param account\r\n */\r\nfunction extractAccountSid(account) {\r\n return account.idTokenClaims?.sid || null;\r\n}\r\nfunction extractLoginHint(account) {\r\n return account.idTokenClaims?.login_hint || null;\r\n}\n\nexport { getAuthorizationCodePayload, getAuthorizeUrl, getStandardAuthorizeRequestParameters, validateAuthorizationResponse };\n//# sourceMappingURL=Authorize.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { CacheOutcome, Constants, SERVER_TELEM_CONSTANTS, Separators } from '../../utils/Constants.mjs';\nimport { AuthError } from '../../error/AuthError.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst skuGroupSeparator = \",\";\r\nconst skuValueSeparator = \"|\";\r\nfunction makeExtraSkuString(params) {\r\n const { skus, libraryName, libraryVersion, extensionName, extensionVersion, } = params;\r\n const skuMap = new Map([\r\n [0, [libraryName, libraryVersion]],\r\n [2, [extensionName, extensionVersion]],\r\n ]);\r\n let skuArr = [];\r\n if (skus?.length) {\r\n skuArr = skus.split(skuGroupSeparator);\r\n // Ignore invalid input sku param\r\n if (skuArr.length < 4) {\r\n return skus;\r\n }\r\n }\r\n else {\r\n skuArr = Array.from({ length: 4 }, () => skuValueSeparator);\r\n }\r\n skuMap.forEach((value, key) => {\r\n if (value.length === 2 && value[0]?.length && value[1]?.length) {\r\n setSku({\r\n skuArr,\r\n index: key,\r\n skuName: value[0],\r\n skuVersion: value[1],\r\n });\r\n }\r\n });\r\n return skuArr.join(skuGroupSeparator);\r\n}\r\nfunction setSku(params) {\r\n const { skuArr, index, skuName, skuVersion } = params;\r\n if (index >= skuArr.length) {\r\n return;\r\n }\r\n skuArr[index] = [skuName, skuVersion].join(skuValueSeparator);\r\n}\r\n/** @internal */\r\nclass ServerTelemetryManager {\r\n constructor(telemetryRequest, cacheManager) {\r\n this.cacheOutcome = CacheOutcome.NOT_APPLICABLE;\r\n this.cacheManager = cacheManager;\r\n this.apiId = telemetryRequest.apiId;\r\n this.correlationId = telemetryRequest.correlationId;\r\n this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;\r\n this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;\r\n this.telemetryCacheKey =\r\n SERVER_TELEM_CONSTANTS.CACHE_KEY +\r\n Separators.CACHE_KEY_SEPARATOR +\r\n telemetryRequest.clientId;\r\n }\r\n /**\r\n * API to add MSER Telemetry to request\r\n */\r\n generateCurrentRequestHeaderValue() {\r\n const request = `${this.apiId}${SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR}${this.cacheOutcome}`;\r\n const platformFieldsArr = [this.wrapperSKU, this.wrapperVer];\r\n const nativeBrokerErrorCode = this.getNativeBrokerErrorCode();\r\n if (nativeBrokerErrorCode?.length) {\r\n platformFieldsArr.push(`broker_error=${nativeBrokerErrorCode}`);\r\n }\r\n const platformFields = platformFieldsArr.join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n const regionDiscoveryFields = this.getRegionDiscoveryFields();\r\n const requestWithRegionDiscoveryFields = [\r\n request,\r\n regionDiscoveryFields,\r\n ].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n return [\r\n SERVER_TELEM_CONSTANTS.SCHEMA_VERSION,\r\n requestWithRegionDiscoveryFields,\r\n platformFields,\r\n ].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\r\n }\r\n /**\r\n * API to add MSER Telemetry for the last failed request\r\n */\r\n generateLastRequestHeaderValue() {\r\n const lastRequests = this.getLastRequests();\r\n const maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);\r\n const failedRequests = lastRequests.failedRequests\r\n .slice(0, 2 * maxErrors)\r\n .join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n const errors = lastRequests.errors\r\n .slice(0, maxErrors)\r\n .join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n const errorCount = lastRequests.errors.length;\r\n // Indicate whether this header contains all data or partial data\r\n const overflow = maxErrors < errorCount\r\n ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE\r\n : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;\r\n const platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n return [\r\n SERVER_TELEM_CONSTANTS.SCHEMA_VERSION,\r\n lastRequests.cacheHits,\r\n failedRequests,\r\n errors,\r\n platformFields,\r\n ].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\r\n }\r\n /**\r\n * API to cache token failures for MSER data capture\r\n * @param error\r\n */\r\n cacheFailedRequest(error) {\r\n const lastRequests = this.getLastRequests();\r\n if (lastRequests.errors.length >=\r\n SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {\r\n // Remove a cached error to make room, first in first out\r\n lastRequests.failedRequests.shift(); // apiId\r\n lastRequests.failedRequests.shift(); // correlationId\r\n lastRequests.errors.shift();\r\n }\r\n lastRequests.failedRequests.push(this.apiId, this.correlationId);\r\n if (error instanceof Error && !!error && error.toString()) {\r\n if (error instanceof AuthError) {\r\n if (error.subError) {\r\n lastRequests.errors.push(error.subError);\r\n }\r\n else if (error.errorCode) {\r\n lastRequests.errors.push(error.errorCode);\r\n }\r\n else {\r\n lastRequests.errors.push(error.toString());\r\n }\r\n }\r\n else {\r\n lastRequests.errors.push(error.toString());\r\n }\r\n }\r\n else {\r\n lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);\r\n }\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n return;\r\n }\r\n /**\r\n * Update server telemetry cache entry by incrementing cache hit counter\r\n */\r\n incrementCacheHits() {\r\n const lastRequests = this.getLastRequests();\r\n lastRequests.cacheHits += 1;\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n return lastRequests.cacheHits;\r\n }\r\n /**\r\n * Get the server telemetry entity from cache or initialize a new one\r\n */\r\n getLastRequests() {\r\n const initialValue = {\r\n failedRequests: [],\r\n errors: [],\r\n cacheHits: 0,\r\n };\r\n const lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey);\r\n return lastRequests || initialValue;\r\n }\r\n /**\r\n * Remove server telemetry cache entry\r\n */\r\n clearTelemetryCache() {\r\n const lastRequests = this.getLastRequests();\r\n const numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);\r\n const errorCount = lastRequests.errors.length;\r\n if (numErrorsFlushed === errorCount) {\r\n // All errors were sent on last request, clear Telemetry cache\r\n this.cacheManager.removeItem(this.telemetryCacheKey);\r\n }\r\n else {\r\n // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed\r\n const serverTelemEntity = {\r\n failedRequests: lastRequests.failedRequests.slice(numErrorsFlushed * 2),\r\n errors: lastRequests.errors.slice(numErrorsFlushed),\r\n cacheHits: 0,\r\n };\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);\r\n }\r\n }\r\n /**\r\n * Returns the maximum number of errors that can be flushed to the server in the next network request\r\n * @param serverTelemetryEntity\r\n */\r\n static maxErrorsToSend(serverTelemetryEntity) {\r\n let i;\r\n let maxErrors = 0;\r\n let dataSize = 0;\r\n const errorCount = serverTelemetryEntity.errors.length;\r\n for (i = 0; i < errorCount; i++) {\r\n // failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs\r\n const apiId = serverTelemetryEntity.failedRequests[2 * i] ||\r\n Constants.EMPTY_STRING;\r\n const correlationId = serverTelemetryEntity.failedRequests[2 * i + 1] ||\r\n Constants.EMPTY_STRING;\r\n const errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;\r\n // Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators\r\n dataSize +=\r\n apiId.toString().length +\r\n correlationId.toString().length +\r\n errorCode.length +\r\n 3;\r\n if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {\r\n // Adding this entry to the header would still keep header size below the limit\r\n maxErrors += 1;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n return maxErrors;\r\n }\r\n /**\r\n * Get the region discovery fields\r\n *\r\n * @returns string\r\n */\r\n getRegionDiscoveryFields() {\r\n const regionDiscoveryFields = [];\r\n regionDiscoveryFields.push(this.regionUsed || Constants.EMPTY_STRING);\r\n regionDiscoveryFields.push(this.regionSource || Constants.EMPTY_STRING);\r\n regionDiscoveryFields.push(this.regionOutcome || Constants.EMPTY_STRING);\r\n return regionDiscoveryFields.join(\",\");\r\n }\r\n /**\r\n * Update the region discovery metadata\r\n *\r\n * @param regionDiscoveryMetadata\r\n * @returns void\r\n */\r\n updateRegionDiscoveryMetadata(regionDiscoveryMetadata) {\r\n this.regionUsed = regionDiscoveryMetadata.region_used;\r\n this.regionSource = regionDiscoveryMetadata.region_source;\r\n this.regionOutcome = regionDiscoveryMetadata.region_outcome;\r\n }\r\n /**\r\n * Set cache outcome\r\n */\r\n setCacheOutcome(cacheOutcome) {\r\n this.cacheOutcome = cacheOutcome;\r\n }\r\n setNativeBrokerErrorCode(errorCode) {\r\n const lastRequests = this.getLastRequests();\r\n lastRequests.nativeBrokerErrorCode = errorCode;\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n }\r\n getNativeBrokerErrorCode() {\r\n return this.getLastRequests().nativeBrokerErrorCode;\r\n }\r\n clearNativeBrokerErrorCode() {\r\n const lastRequests = this.getLastRequests();\r\n delete lastRequests.nativeBrokerErrorCode;\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n }\r\n static makeExtraSkuString(params) {\r\n return makeExtraSkuString(params);\r\n }\r\n}\n\nexport { ServerTelemetryManager };\n//# sourceMappingURL=ServerTelemetryManager.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst missingKidError = \"missing_kid_error\";\r\nconst missingAlgError = \"missing_alg_error\";\n\nexport { missingAlgError, missingKidError };\n//# sourceMappingURL=JoseHeaderErrorCodes.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { AuthError } from './AuthError.mjs';\nimport { missingKidError, missingAlgError } from './JoseHeaderErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst JoseHeaderErrorMessages = {\r\n [missingKidError]: \"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.\",\r\n [missingAlgError]: \"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided.\",\r\n};\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nclass JoseHeaderError extends AuthError {\r\n constructor(errorCode, errorMessage) {\r\n super(errorCode, errorMessage);\r\n this.name = \"JoseHeaderError\";\r\n Object.setPrototypeOf(this, JoseHeaderError.prototype);\r\n }\r\n}\r\n/** Returns JoseHeaderError object */\r\nfunction createJoseHeaderError(code) {\r\n return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);\r\n}\n\nexport { JoseHeaderError, JoseHeaderErrorMessages, createJoseHeaderError };\n//# sourceMappingURL=JoseHeaderError.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { createJoseHeaderError } from '../error/JoseHeaderError.mjs';\nimport { JsonWebTokenTypes } from '../utils/Constants.mjs';\nimport { missingKidError, missingAlgError } from '../error/JoseHeaderErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/** @internal */\r\nclass JoseHeader {\r\n constructor(options) {\r\n this.typ = options.typ;\r\n this.alg = options.alg;\r\n this.kid = options.kid;\r\n }\r\n /**\r\n * Builds SignedHttpRequest formatted JOSE Header from the\r\n * JOSE Header options provided or previously set on the object and returns\r\n * the stringified header object.\r\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\r\n * @param shrHeaderOptions\r\n * @returns\r\n */\r\n static getShrHeaderString(shrHeaderOptions) {\r\n // KeyID is required on the SHR header\r\n if (!shrHeaderOptions.kid) {\r\n throw createJoseHeaderError(missingKidError);\r\n }\r\n // Alg is required on the SHR header\r\n if (!shrHeaderOptions.alg) {\r\n throw createJoseHeaderError(missingAlgError);\r\n }\r\n const shrHeader = new JoseHeader({\r\n // Access Token PoP headers must have type pop, but the type header can be overriden for special cases\r\n typ: shrHeaderOptions.typ || JsonWebTokenTypes.Pop,\r\n kid: shrHeaderOptions.kid,\r\n alg: shrHeaderOptions.alg,\r\n });\r\n return JSON.stringify(shrHeader);\r\n }\r\n}\n\nexport { JoseHeader };\n//# sourceMappingURL=JoseHeader.mjs.map\n","/*! @azure/msal-common v15.3.0 2025-03-20 */\n'use strict';\nimport { PerformanceEventStatus } from './PerformanceEvent.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass StubPerformanceMeasurement {\r\n startMeasurement() {\r\n return;\r\n }\r\n endMeasurement() {\r\n return;\r\n }\r\n flushMeasurement() {\r\n return null;\r\n }\r\n}\r\nclass StubPerformanceClient {\r\n generateId() {\r\n return \"callback-id\";\r\n }\r\n startMeasurement(measureName, correlationId) {\r\n return {\r\n end: () => null,\r\n discard: () => { },\r\n add: () => { },\r\n increment: () => { },\r\n event: {\r\n eventId: this.generateId(),\r\n status: PerformanceEventStatus.InProgress,\r\n authority: \"\",\r\n libraryName: \"\",\r\n libraryVersion: \"\",\r\n clientId: \"\",\r\n name: measureName,\r\n startTimeMs: Date.now(),\r\n correlationId: correlationId || \"\",\r\n },\r\n measurement: new StubPerformanceMeasurement(),\r\n };\r\n }\r\n startPerformanceMeasurement() {\r\n return new StubPerformanceMeasurement();\r\n }\r\n calculateQueuedTime() {\r\n return 0;\r\n }\r\n addQueueMeasurement() {\r\n return;\r\n }\r\n setPreQueueTime() {\r\n return;\r\n }\r\n endMeasurement() {\r\n return null;\r\n }\r\n discardMeasurements() {\r\n return;\r\n }\r\n removePerformanceCallback() {\r\n return true;\r\n }\r\n addPerformanceCallback() {\r\n return \"\";\r\n }\r\n emitEvents() {\r\n return;\r\n }\r\n addFields() {\r\n return;\r\n }\r\n incrementFields() {\r\n return;\r\n }\r\n cacheEventByCorrelationId() {\r\n return;\r\n }\r\n}\n\nexport { StubPerformanceClient, StubPerformanceMeasurement };\n//# sourceMappingURL=StubPerformanceClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst pkceNotCreated = \"pkce_not_created\";\r\nconst cryptoNonExistent = \"crypto_nonexistent\";\r\nconst emptyNavigateUri = \"empty_navigate_uri\";\r\nconst hashEmptyError = \"hash_empty_error\";\r\nconst noStateInHash = \"no_state_in_hash\";\r\nconst hashDoesNotContainKnownProperties = \"hash_does_not_contain_known_properties\";\r\nconst unableToParseState = \"unable_to_parse_state\";\r\nconst stateInteractionTypeMismatch = \"state_interaction_type_mismatch\";\r\nconst interactionInProgress = \"interaction_in_progress\";\r\nconst popupWindowError = \"popup_window_error\";\r\nconst emptyWindowError = \"empty_window_error\";\r\nconst userCancelled = \"user_cancelled\";\r\nconst monitorPopupTimeout = \"monitor_popup_timeout\";\r\nconst monitorWindowTimeout = \"monitor_window_timeout\";\r\nconst redirectInIframe = \"redirect_in_iframe\";\r\nconst blockIframeReload = \"block_iframe_reload\";\r\nconst blockNestedPopups = \"block_nested_popups\";\r\nconst iframeClosedPrematurely = \"iframe_closed_prematurely\";\r\nconst silentLogoutUnsupported = \"silent_logout_unsupported\";\r\nconst noAccountError = \"no_account_error\";\r\nconst silentPromptValueError = \"silent_prompt_value_error\";\r\nconst noTokenRequestCacheError = \"no_token_request_cache_error\";\r\nconst unableToParseTokenRequestCacheError = \"unable_to_parse_token_request_cache_error\";\r\nconst noCachedAuthorityError = \"no_cached_authority_error\";\r\nconst authRequestNotSetError = \"auth_request_not_set_error\";\r\nconst invalidCacheType = \"invalid_cache_type\";\r\nconst nonBrowserEnvironment = \"non_browser_environment\";\r\nconst databaseNotOpen = \"database_not_open\";\r\nconst noNetworkConnectivity = \"no_network_connectivity\";\r\nconst postRequestFailed = \"post_request_failed\";\r\nconst getRequestFailed = \"get_request_failed\";\r\nconst failedToParseResponse = \"failed_to_parse_response\";\r\nconst unableToLoadToken = \"unable_to_load_token\";\r\nconst cryptoKeyNotFound = \"crypto_key_not_found\";\r\nconst authCodeRequired = \"auth_code_required\";\r\nconst authCodeOrNativeAccountIdRequired = \"auth_code_or_nativeAccountId_required\";\r\nconst spaCodeAndNativeAccountIdPresent = \"spa_code_and_nativeAccountId_present\";\r\nconst databaseUnavailable = \"database_unavailable\";\r\nconst unableToAcquireTokenFromNativePlatform = \"unable_to_acquire_token_from_native_platform\";\r\nconst nativeHandshakeTimeout = \"native_handshake_timeout\";\r\nconst nativeExtensionNotInstalled = \"native_extension_not_installed\";\r\nconst nativeConnectionNotEstablished = \"native_connection_not_established\";\r\nconst uninitializedPublicClientApplication = \"uninitialized_public_client_application\";\r\nconst nativePromptNotSupported = \"native_prompt_not_supported\";\r\nconst invalidBase64String = \"invalid_base64_string\";\r\nconst invalidPopTokenRequest = \"invalid_pop_token_request\";\r\nconst failedToBuildHeaders = \"failed_to_build_headers\";\r\nconst failedToParseHeaders = \"failed_to_parse_headers\";\n\nexport { authCodeOrNativeAccountIdRequired, authCodeRequired, authRequestNotSetError, blockIframeReload, blockNestedPopups, cryptoKeyNotFound, cryptoNonExistent, databaseNotOpen, databaseUnavailable, emptyNavigateUri, emptyWindowError, failedToBuildHeaders, failedToParseHeaders, failedToParseResponse, getRequestFailed, hashDoesNotContainKnownProperties, hashEmptyError, iframeClosedPrematurely, interactionInProgress, invalidBase64String, invalidCacheType, invalidPopTokenRequest, monitorPopupTimeout, monitorWindowTimeout, nativeConnectionNotEstablished, nativeExtensionNotInstalled, nativeHandshakeTimeout, nativePromptNotSupported, noAccountError, noCachedAuthorityError, noNetworkConnectivity, noStateInHash, noTokenRequestCacheError, nonBrowserEnvironment, pkceNotCreated, popupWindowError, postRequestFailed, redirectInIframe, silentLogoutUnsupported, silentPromptValueError, spaCodeAndNativeAccountIdPresent, stateInteractionTypeMismatch, unableToAcquireTokenFromNativePlatform, unableToLoadToken, unableToParseState, unableToParseTokenRequestCacheError, uninitializedPublicClientApplication, userCancelled };\n//# sourceMappingURL=BrowserAuthErrorCodes.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AuthError } from '@azure/msal-common/browser';\nimport { pkceNotCreated, cryptoNonExistent, emptyNavigateUri, hashEmptyError, noStateInHash, hashDoesNotContainKnownProperties, unableToParseState, stateInteractionTypeMismatch, interactionInProgress, popupWindowError, emptyWindowError, userCancelled, monitorPopupTimeout, monitorWindowTimeout, redirectInIframe, blockIframeReload, blockNestedPopups, iframeClosedPrematurely, silentLogoutUnsupported, noAccountError, silentPromptValueError, noTokenRequestCacheError, unableToParseTokenRequestCacheError, noCachedAuthorityError, authRequestNotSetError, invalidCacheType, nonBrowserEnvironment, databaseNotOpen, noNetworkConnectivity, postRequestFailed, getRequestFailed, failedToParseResponse, unableToLoadToken, cryptoKeyNotFound, authCodeRequired, authCodeOrNativeAccountIdRequired, spaCodeAndNativeAccountIdPresent, databaseUnavailable, unableToAcquireTokenFromNativePlatform, nativeHandshakeTimeout, nativeExtensionNotInstalled, nativeConnectionNotEstablished, uninitializedPublicClientApplication, nativePromptNotSupported, invalidBase64String, invalidPopTokenRequest, failedToBuildHeaders, failedToParseHeaders } from './BrowserAuthErrorCodes.mjs';\nimport * as BrowserAuthErrorCodes from './BrowserAuthErrorCodes.mjs';\nexport { BrowserAuthErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst ErrorLink = \"For more visit: aka.ms/msaljs/browser-errors\";\r\n/**\r\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nconst BrowserAuthErrorMessages = {\r\n [pkceNotCreated]: \"The PKCE code challenge and verifier could not be generated.\",\r\n [cryptoNonExistent]: \"The crypto object or function is not available.\",\r\n [emptyNavigateUri]: \"Navigation URI is empty. Please check stack trace for more info.\",\r\n [hashEmptyError]: `Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${ErrorLink}`,\r\n [noStateInHash]: \"Hash does not contain state. Please verify that the request originated from msal.\",\r\n [hashDoesNotContainKnownProperties]: `Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${ErrorLink}`,\r\n [unableToParseState]: \"Unable to parse state. Please verify that the request originated from msal.\",\r\n [stateInteractionTypeMismatch]: \"Hash contains state but the interaction type does not match the caller.\",\r\n [interactionInProgress]: `Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${ErrorLink}`,\r\n [popupWindowError]: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\",\r\n [emptyWindowError]: \"window.open returned null or undefined window object.\",\r\n [userCancelled]: \"User cancelled the flow.\",\r\n [monitorPopupTimeout]: `Token acquisition in popup failed due to timeout. ${ErrorLink}`,\r\n [monitorWindowTimeout]: `Token acquisition in iframe failed due to timeout. ${ErrorLink}`,\r\n [redirectInIframe]: \"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.\",\r\n [blockIframeReload]: `Request was blocked inside an iframe because MSAL detected an authentication response. ${ErrorLink}`,\r\n [blockNestedPopups]: \"Request was blocked inside a popup because MSAL detected it was running in a popup.\",\r\n [iframeClosedPrematurely]: \"The iframe being monitored was closed prematurely.\",\r\n [silentLogoutUnsupported]: \"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.\",\r\n [noAccountError]: \"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.\",\r\n [silentPromptValueError]: \"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.\",\r\n [noTokenRequestCacheError]: \"No token request found in cache.\",\r\n [unableToParseTokenRequestCacheError]: \"The cached token request could not be parsed.\",\r\n [noCachedAuthorityError]: \"No cached authority found.\",\r\n [authRequestNotSetError]: \"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler\",\r\n [invalidCacheType]: \"Invalid cache type\",\r\n [nonBrowserEnvironment]: \"Login and token requests are not supported in non-browser environments.\",\r\n [databaseNotOpen]: \"Database is not open!\",\r\n [noNetworkConnectivity]: \"No network connectivity. Check your internet connection.\",\r\n [postRequestFailed]: \"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'\",\r\n [getRequestFailed]: \"Network request failed. Please check the network trace to determine root cause.\",\r\n [failedToParseResponse]: \"Failed to parse network response. Check network trace.\",\r\n [unableToLoadToken]: \"Error loading token to cache.\",\r\n [cryptoKeyNotFound]: \"Cryptographic Key or Keypair not found in browser storage.\",\r\n [authCodeRequired]: \"An authorization code must be provided (as the `code` property on the request) to this flow.\",\r\n [authCodeOrNativeAccountIdRequired]: \"An authorization code or nativeAccountId must be provided to this flow.\",\r\n [spaCodeAndNativeAccountIdPresent]: \"Request cannot contain both spa code and native account id.\",\r\n [databaseUnavailable]: \"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.\",\r\n [unableToAcquireTokenFromNativePlatform]: `Unable to acquire token from native platform. ${ErrorLink}`,\r\n [nativeHandshakeTimeout]: \"Timed out while attempting to establish connection to browser extension\",\r\n [nativeExtensionNotInstalled]: \"Native extension is not installed. If you think this is a mistake call the initialize function.\",\r\n [nativeConnectionNotEstablished]: `Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${ErrorLink}`,\r\n [uninitializedPublicClientApplication]: `You must call and await the initialize function before attempting to call any other MSAL API. ${ErrorLink}`,\r\n [nativePromptNotSupported]: \"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.\",\r\n [invalidBase64String]: \"Invalid base64 encoded string.\",\r\n [invalidPopTokenRequest]: \"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.\",\r\n [failedToBuildHeaders]: \"Failed to build request headers object.\",\r\n [failedToParseHeaders]: \"Failed to parse response headers\",\r\n};\r\n/**\r\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\r\n * @deprecated Use exported BrowserAuthErrorCodes instead.\r\n * In your app you can do :\r\n * ```\r\n * import { BrowserAuthErrorCodes } from \"@azure/msal-browser\";\r\n * ```\r\n */\r\nconst BrowserAuthErrorMessage = {\r\n pkceNotGenerated: {\r\n code: pkceNotCreated,\r\n desc: BrowserAuthErrorMessages[pkceNotCreated],\r\n },\r\n cryptoDoesNotExist: {\r\n code: cryptoNonExistent,\r\n desc: BrowserAuthErrorMessages[cryptoNonExistent],\r\n },\r\n emptyNavigateUriError: {\r\n code: emptyNavigateUri,\r\n desc: BrowserAuthErrorMessages[emptyNavigateUri],\r\n },\r\n hashEmptyError: {\r\n code: hashEmptyError,\r\n desc: BrowserAuthErrorMessages[hashEmptyError],\r\n },\r\n hashDoesNotContainStateError: {\r\n code: noStateInHash,\r\n desc: BrowserAuthErrorMessages[noStateInHash],\r\n },\r\n hashDoesNotContainKnownPropertiesError: {\r\n code: hashDoesNotContainKnownProperties,\r\n desc: BrowserAuthErrorMessages[hashDoesNotContainKnownProperties],\r\n },\r\n unableToParseStateError: {\r\n code: unableToParseState,\r\n desc: BrowserAuthErrorMessages[unableToParseState],\r\n },\r\n stateInteractionTypeMismatchError: {\r\n code: stateInteractionTypeMismatch,\r\n desc: BrowserAuthErrorMessages[stateInteractionTypeMismatch],\r\n },\r\n interactionInProgress: {\r\n code: interactionInProgress,\r\n desc: BrowserAuthErrorMessages[interactionInProgress],\r\n },\r\n popupWindowError: {\r\n code: popupWindowError,\r\n desc: BrowserAuthErrorMessages[popupWindowError],\r\n },\r\n emptyWindowError: {\r\n code: emptyWindowError,\r\n desc: BrowserAuthErrorMessages[emptyWindowError],\r\n },\r\n userCancelledError: {\r\n code: userCancelled,\r\n desc: BrowserAuthErrorMessages[userCancelled],\r\n },\r\n monitorPopupTimeoutError: {\r\n code: monitorPopupTimeout,\r\n desc: BrowserAuthErrorMessages[monitorPopupTimeout],\r\n },\r\n monitorIframeTimeoutError: {\r\n code: monitorWindowTimeout,\r\n desc: BrowserAuthErrorMessages[monitorWindowTimeout],\r\n },\r\n redirectInIframeError: {\r\n code: redirectInIframe,\r\n desc: BrowserAuthErrorMessages[redirectInIframe],\r\n },\r\n blockTokenRequestsInHiddenIframeError: {\r\n code: blockIframeReload,\r\n desc: BrowserAuthErrorMessages[blockIframeReload],\r\n },\r\n blockAcquireTokenInPopupsError: {\r\n code: blockNestedPopups,\r\n desc: BrowserAuthErrorMessages[blockNestedPopups],\r\n },\r\n iframeClosedPrematurelyError: {\r\n code: iframeClosedPrematurely,\r\n desc: BrowserAuthErrorMessages[iframeClosedPrematurely],\r\n },\r\n silentLogoutUnsupportedError: {\r\n code: silentLogoutUnsupported,\r\n desc: BrowserAuthErrorMessages[silentLogoutUnsupported],\r\n },\r\n noAccountError: {\r\n code: noAccountError,\r\n desc: BrowserAuthErrorMessages[noAccountError],\r\n },\r\n silentPromptValueError: {\r\n code: silentPromptValueError,\r\n desc: BrowserAuthErrorMessages[silentPromptValueError],\r\n },\r\n noTokenRequestCacheError: {\r\n code: noTokenRequestCacheError,\r\n desc: BrowserAuthErrorMessages[noTokenRequestCacheError],\r\n },\r\n unableToParseTokenRequestCacheError: {\r\n code: unableToParseTokenRequestCacheError,\r\n desc: BrowserAuthErrorMessages[unableToParseTokenRequestCacheError],\r\n },\r\n noCachedAuthorityError: {\r\n code: noCachedAuthorityError,\r\n desc: BrowserAuthErrorMessages[noCachedAuthorityError],\r\n },\r\n authRequestNotSet: {\r\n code: authRequestNotSetError,\r\n desc: BrowserAuthErrorMessages[authRequestNotSetError],\r\n },\r\n invalidCacheType: {\r\n code: invalidCacheType,\r\n desc: BrowserAuthErrorMessages[invalidCacheType],\r\n },\r\n notInBrowserEnvironment: {\r\n code: nonBrowserEnvironment,\r\n desc: BrowserAuthErrorMessages[nonBrowserEnvironment],\r\n },\r\n databaseNotOpen: {\r\n code: databaseNotOpen,\r\n desc: BrowserAuthErrorMessages[databaseNotOpen],\r\n },\r\n noNetworkConnectivity: {\r\n code: noNetworkConnectivity,\r\n desc: BrowserAuthErrorMessages[noNetworkConnectivity],\r\n },\r\n postRequestFailed: {\r\n code: postRequestFailed,\r\n desc: BrowserAuthErrorMessages[postRequestFailed],\r\n },\r\n getRequestFailed: {\r\n code: getRequestFailed,\r\n desc: BrowserAuthErrorMessages[getRequestFailed],\r\n },\r\n failedToParseNetworkResponse: {\r\n code: failedToParseResponse,\r\n desc: BrowserAuthErrorMessages[failedToParseResponse],\r\n },\r\n unableToLoadTokenError: {\r\n code: unableToLoadToken,\r\n desc: BrowserAuthErrorMessages[unableToLoadToken],\r\n },\r\n signingKeyNotFoundInStorage: {\r\n code: cryptoKeyNotFound,\r\n desc: BrowserAuthErrorMessages[cryptoKeyNotFound],\r\n },\r\n authCodeRequired: {\r\n code: authCodeRequired,\r\n desc: BrowserAuthErrorMessages[authCodeRequired],\r\n },\r\n authCodeOrNativeAccountRequired: {\r\n code: authCodeOrNativeAccountIdRequired,\r\n desc: BrowserAuthErrorMessages[authCodeOrNativeAccountIdRequired],\r\n },\r\n spaCodeAndNativeAccountPresent: {\r\n code: spaCodeAndNativeAccountIdPresent,\r\n desc: BrowserAuthErrorMessages[spaCodeAndNativeAccountIdPresent],\r\n },\r\n databaseUnavailable: {\r\n code: databaseUnavailable,\r\n desc: BrowserAuthErrorMessages[databaseUnavailable],\r\n },\r\n unableToAcquireTokenFromNativePlatform: {\r\n code: unableToAcquireTokenFromNativePlatform,\r\n desc: BrowserAuthErrorMessages[unableToAcquireTokenFromNativePlatform],\r\n },\r\n nativeHandshakeTimeout: {\r\n code: nativeHandshakeTimeout,\r\n desc: BrowserAuthErrorMessages[nativeHandshakeTimeout],\r\n },\r\n nativeExtensionNotInstalled: {\r\n code: nativeExtensionNotInstalled,\r\n desc: BrowserAuthErrorMessages[nativeExtensionNotInstalled],\r\n },\r\n nativeConnectionNotEstablished: {\r\n code: nativeConnectionNotEstablished,\r\n desc: BrowserAuthErrorMessages[nativeConnectionNotEstablished],\r\n },\r\n uninitializedPublicClientApplication: {\r\n code: uninitializedPublicClientApplication,\r\n desc: BrowserAuthErrorMessages[uninitializedPublicClientApplication],\r\n },\r\n nativePromptNotSupported: {\r\n code: nativePromptNotSupported,\r\n desc: BrowserAuthErrorMessages[nativePromptNotSupported],\r\n },\r\n invalidBase64StringError: {\r\n code: invalidBase64String,\r\n desc: BrowserAuthErrorMessages[invalidBase64String],\r\n },\r\n invalidPopTokenRequest: {\r\n code: invalidPopTokenRequest,\r\n desc: BrowserAuthErrorMessages[invalidPopTokenRequest],\r\n },\r\n};\r\n/**\r\n * Browser library error class thrown by the MSAL.js library for SPAs\r\n */\r\nclass BrowserAuthError extends AuthError {\r\n constructor(errorCode, subError) {\r\n super(errorCode, BrowserAuthErrorMessages[errorCode], subError);\r\n Object.setPrototypeOf(this, BrowserAuthError.prototype);\r\n this.name = \"BrowserAuthError\";\r\n }\r\n}\r\nfunction createBrowserAuthError(errorCode, subError) {\r\n return new BrowserAuthError(errorCode, subError);\r\n}\n\nexport { BrowserAuthError, BrowserAuthErrorMessage, BrowserAuthErrorMessages, createBrowserAuthError };\n//# sourceMappingURL=BrowserAuthError.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { OIDC_DEFAULT_SCOPES } from '@azure/msal-common/browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Constants\r\n */\r\nconst BrowserConstants = {\r\n /**\r\n * Interaction in progress cache value\r\n */\r\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\r\n /**\r\n * Invalid grant error code\r\n */\r\n INVALID_GRANT_ERROR: \"invalid_grant\",\r\n /**\r\n * Default popup window width\r\n */\r\n POPUP_WIDTH: 483,\r\n /**\r\n * Default popup window height\r\n */\r\n POPUP_HEIGHT: 600,\r\n /**\r\n * Name of the popup window starts with\r\n */\r\n POPUP_NAME_PREFIX: \"msal\",\r\n /**\r\n * Default popup monitor poll interval in milliseconds\r\n */\r\n DEFAULT_POLL_INTERVAL_MS: 30,\r\n /**\r\n * Msal-browser SKU\r\n */\r\n MSAL_SKU: \"msal.js.browser\",\r\n};\r\nconst NativeConstants = {\r\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\r\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\r\n MATS_TELEMETRY: \"MATS\",\r\n};\r\nconst NativeExtensionMethod = {\r\n HandshakeRequest: \"Handshake\",\r\n HandshakeResponse: \"HandshakeResponse\",\r\n GetToken: \"GetToken\",\r\n Response: \"Response\",\r\n};\r\nconst BrowserCacheLocation = {\r\n LocalStorage: \"localStorage\",\r\n SessionStorage: \"sessionStorage\",\r\n MemoryStorage: \"memoryStorage\",\r\n};\r\n/**\r\n * HTTP Request types supported by MSAL.\r\n */\r\nconst HTTP_REQUEST_TYPE = {\r\n GET: \"GET\",\r\n POST: \"POST\",\r\n};\r\n/**\r\n * Temporary cache keys for MSAL, deleted after any request.\r\n */\r\nconst TemporaryCacheKeys = {\r\n AUTHORITY: \"authority\",\r\n ACQUIRE_TOKEN_ACCOUNT: \"acquireToken.account\",\r\n SESSION_STATE: \"session.state\",\r\n REQUEST_STATE: \"request.state\",\r\n NONCE_IDTOKEN: \"nonce.id_token\",\r\n ORIGIN_URI: \"request.origin\",\r\n RENEW_STATUS: \"token.renew.status\",\r\n URL_HASH: \"urlHash\",\r\n REQUEST_PARAMS: \"request.params\",\r\n SCOPES: \"scopes\",\r\n INTERACTION_STATUS_KEY: \"interaction.status\",\r\n CCS_CREDENTIAL: \"ccs.credential\",\r\n CORRELATION_ID: \"request.correlationId\",\r\n NATIVE_REQUEST: \"request.native\",\r\n REDIRECT_CONTEXT: \"request.redirect.context\",\r\n};\r\nconst StaticCacheKeys = {\r\n ACCOUNT_KEYS: \"msal.account.keys\",\r\n TOKEN_KEYS: \"msal.token.keys\",\r\n};\r\n/**\r\n * Cache keys stored in-memory\r\n */\r\nconst InMemoryCacheKeys = {\r\n WRAPPER_SKU: \"wrapper.sku\",\r\n WRAPPER_VER: \"wrapper.version\",\r\n};\r\n/**\r\n * API Codes for Telemetry purposes.\r\n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\r\n * 0-99 Silent Flow\r\n * 800-899 Auth Code Flow\r\n */\r\nconst ApiId = {\r\n acquireTokenRedirect: 861,\r\n acquireTokenPopup: 862,\r\n ssoSilent: 863,\r\n acquireTokenSilent_authCode: 864,\r\n handleRedirectPromise: 865,\r\n acquireTokenByCode: 866,\r\n acquireTokenSilent_silentFlow: 61,\r\n logout: 961,\r\n logoutPopup: 962,\r\n};\r\n/*\r\n * Interaction type of the API - used for state and telemetry\r\n */\r\nvar InteractionType;\r\n(function (InteractionType) {\r\n InteractionType[\"Redirect\"] = \"redirect\";\r\n InteractionType[\"Popup\"] = \"popup\";\r\n InteractionType[\"Silent\"] = \"silent\";\r\n InteractionType[\"None\"] = \"none\";\r\n})(InteractionType || (InteractionType = {}));\r\n/**\r\n * Types of interaction currently in progress.\r\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\r\n */\r\nconst InteractionStatus = {\r\n /**\r\n * Initial status before interaction occurs\r\n */\r\n Startup: \"startup\",\r\n /**\r\n * Status set when all login calls occuring\r\n */\r\n Login: \"login\",\r\n /**\r\n * Status set when logout call occuring\r\n */\r\n Logout: \"logout\",\r\n /**\r\n * Status set for acquireToken calls\r\n */\r\n AcquireToken: \"acquireToken\",\r\n /**\r\n * Status set for ssoSilent calls\r\n */\r\n SsoSilent: \"ssoSilent\",\r\n /**\r\n * Status set when handleRedirect in progress\r\n */\r\n HandleRedirect: \"handleRedirect\",\r\n /**\r\n * Status set when interaction is complete\r\n */\r\n None: \"none\",\r\n};\r\nconst DEFAULT_REQUEST = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n};\r\n/**\r\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\r\n */\r\nconst KEY_FORMAT_JWK = \"jwk\";\r\n// Supported wrapper SKUs\r\nconst WrapperSKU = {\r\n React: \"@azure/msal-react\",\r\n Angular: \"@azure/msal-angular\",\r\n};\r\n// DatabaseStorage Constants\r\nconst DB_NAME = \"msal.db\";\r\nconst DB_VERSION = 1;\r\nconst DB_TABLE_NAME = `${DB_NAME}.keys`;\r\nconst CacheLookupPolicy = {\r\n /*\r\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\r\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\r\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\r\n */\r\n Default: 0,\r\n /*\r\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\r\n * refresh tokens.\r\n */\r\n AccessToken: 1,\r\n /*\r\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\r\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\r\n * will not be renewed and acquireTokenSilent will fail.\r\n */\r\n AccessTokenAndRefreshToken: 2,\r\n /*\r\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\r\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\r\n * renewed and acquireTokenSilent will fail.\r\n */\r\n RefreshToken: 3,\r\n /*\r\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\r\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\r\n * setting \"forceRefresh: true\".\r\n */\r\n RefreshTokenAndNetwork: 4,\r\n /*\r\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\r\n * always fail if 3rd party cookies are blocked by the browser.\r\n */\r\n Skip: 5,\r\n};\r\nconst iFrameRenewalPolicies = [\r\n CacheLookupPolicy.Default,\r\n CacheLookupPolicy.Skip,\r\n CacheLookupPolicy.RefreshTokenAndNetwork,\r\n];\r\nconst LOG_LEVEL_CACHE_KEY = \"msal.browser.log.level\";\r\nconst LOG_PII_CACHE_KEY = \"msal.browser.log.pii\";\r\nconst BROWSER_PERF_ENABLED_KEY = \"msal.browser.performance.enabled\";\n\nexport { ApiId, BROWSER_PERF_ENABLED_KEY, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, LOG_LEVEL_CACHE_KEY, LOG_PII_CACHE_KEY, NativeConstants, NativeExtensionMethod, StaticCacheKeys, TemporaryCacheKeys, WrapperSKU, iFrameRenewalPolicies };\n//# sourceMappingURL=BrowserConstants.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:\r\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\r\n */\r\n/**\r\n * Returns URL Safe b64 encoded string from a plaintext string.\r\n * @param input\r\n */\r\nfunction urlEncode(input) {\r\n return encodeURIComponent(base64Encode(input)\r\n .replace(/=/g, \"\")\r\n .replace(/\\+/g, \"-\")\r\n .replace(/\\//g, \"_\"));\r\n}\r\n/**\r\n * Returns URL Safe b64 encoded string from an int8Array.\r\n * @param inputArr\r\n */\r\nfunction urlEncodeArr(inputArr) {\r\n return base64EncArr(inputArr)\r\n .replace(/=/g, \"\")\r\n .replace(/\\+/g, \"-\")\r\n .replace(/\\//g, \"_\");\r\n}\r\n/**\r\n * Returns b64 encoded string from plaintext string.\r\n * @param input\r\n */\r\nfunction base64Encode(input) {\r\n return base64EncArr(new TextEncoder().encode(input));\r\n}\r\n/**\r\n * Base64 encode byte array\r\n * @param aBytes\r\n */\r\nfunction base64EncArr(aBytes) {\r\n const binString = Array.from(aBytes, (x) => String.fromCodePoint(x)).join(\"\");\r\n return btoa(binString);\r\n}\n\nexport { base64Encode, urlEncode, urlEncodeArr };\n//# sourceMappingURL=Base64Encode.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { invalidBase64String } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:\r\n * https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem\r\n */\r\n/**\r\n * Returns a URL-safe plaintext decoded string from b64 encoded input.\r\n * @param input\r\n */\r\nfunction base64Decode(input) {\r\n return new TextDecoder().decode(base64DecToArr(input));\r\n}\r\n/**\r\n * Decodes base64 into Uint8Array\r\n * @param base64String\r\n */\r\nfunction base64DecToArr(base64String) {\r\n let encodedString = base64String.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n switch (encodedString.length % 4) {\r\n case 0:\r\n break;\r\n case 2:\r\n encodedString += \"==\";\r\n break;\r\n case 3:\r\n encodedString += \"=\";\r\n break;\r\n default:\r\n throw createBrowserAuthError(invalidBase64String);\r\n }\r\n const binString = atob(encodedString);\r\n return Uint8Array.from(binString, (m) => m.codePointAt(0) || 0);\r\n}\n\nexport { base64DecToArr, base64Decode };\n//# sourceMappingURL=Base64Decode.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { PerformanceEvents } from '@azure/msal-common/browser';\nimport { KEY_FORMAT_JWK } from '../utils/BrowserConstants.mjs';\nimport { urlEncodeArr } from '../encode/Base64Encode.mjs';\nimport { base64DecToArr } from '../encode/Base64Decode.mjs';\nimport { nonBrowserEnvironment, cryptoNonExistent } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This file defines functions used by the browser library to perform cryptography operations such as\r\n * hashing and encoding. It also has helper functions to validate the availability of specific APIs.\r\n */\r\n/**\r\n * See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams\r\n */\r\n// Algorithms\r\nconst PKCS1_V15_KEYGEN_ALG = \"RSASSA-PKCS1-v1_5\";\r\nconst AES_GCM = \"AES-GCM\";\r\nconst HKDF = \"HKDF\";\r\n// SHA-256 hashing algorithm\r\nconst S256_HASH_ALG = \"SHA-256\";\r\n// MOD length for PoP tokens\r\nconst MODULUS_LENGTH = 2048;\r\n// Public Exponent\r\nconst PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);\r\n// UUID hex digits\r\nconst UUID_CHARS = \"0123456789abcdef\";\r\n// Array to store UINT32 random value\r\nconst UINT32_ARR = new Uint32Array(1);\r\n// Key Format\r\nconst RAW = \"raw\";\r\n// Key Usages\r\nconst ENCRYPT = \"encrypt\";\r\nconst DECRYPT = \"decrypt\";\r\nconst DERIVE_KEY = \"deriveKey\";\r\n// Suberror\r\nconst SUBTLE_SUBERROR = \"crypto_subtle_undefined\";\r\nconst keygenAlgorithmOptions = {\r\n name: PKCS1_V15_KEYGEN_ALG,\r\n hash: S256_HASH_ALG,\r\n modulusLength: MODULUS_LENGTH,\r\n publicExponent: PUBLIC_EXPONENT,\r\n};\r\n/**\r\n * Check whether browser crypto is available.\r\n */\r\nfunction validateCryptoAvailable(skipValidateSubtleCrypto) {\r\n if (!window) {\r\n throw createBrowserAuthError(nonBrowserEnvironment);\r\n }\r\n if (!window.crypto) {\r\n throw createBrowserAuthError(cryptoNonExistent);\r\n }\r\n if (!skipValidateSubtleCrypto && !window.crypto.subtle) {\r\n throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);\r\n }\r\n}\r\n/**\r\n * Returns a sha-256 hash of the given dataString as an ArrayBuffer.\r\n * @param dataString {string} data string\r\n * @param performanceClient {?IPerformanceClient}\r\n * @param correlationId {?string} correlation id\r\n */\r\nasync function sha256Digest(dataString, performanceClient, correlationId) {\r\n performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);\r\n const encoder = new TextEncoder();\r\n const data = encoder.encode(dataString);\r\n return window.crypto.subtle.digest(S256_HASH_ALG, data);\r\n}\r\n/**\r\n * Populates buffer with cryptographically random values.\r\n * @param dataBuffer\r\n */\r\nfunction getRandomValues(dataBuffer) {\r\n return window.crypto.getRandomValues(dataBuffer);\r\n}\r\n/**\r\n * Returns random Uint32 value.\r\n * @returns {number}\r\n */\r\nfunction getRandomUint32() {\r\n window.crypto.getRandomValues(UINT32_ARR);\r\n return UINT32_ARR[0];\r\n}\r\n/**\r\n * Creates a UUID v7 from the current timestamp.\r\n * Implementation relies on the system clock to guarantee increasing order of generated identifiers.\r\n * @returns {number}\r\n */\r\nfunction createNewGuid() {\r\n const currentTimestamp = Date.now();\r\n const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);\r\n // Result byte array\r\n const bytes = new Uint8Array(16);\r\n // A 12-bit `rand_a` field value\r\n const randA = Math.trunc(baseRand / 2 ** 30);\r\n // The higher 30 bits of 62-bit `rand_b` field value\r\n const randBHi = baseRand & (2 ** 30 - 1);\r\n // The lower 32 bits of 62-bit `rand_b` field value\r\n const randBLo = getRandomUint32();\r\n bytes[0] = currentTimestamp / 2 ** 40;\r\n bytes[1] = currentTimestamp / 2 ** 32;\r\n bytes[2] = currentTimestamp / 2 ** 24;\r\n bytes[3] = currentTimestamp / 2 ** 16;\r\n bytes[4] = currentTimestamp / 2 ** 8;\r\n bytes[5] = currentTimestamp;\r\n bytes[6] = 0x70 | (randA >>> 8);\r\n bytes[7] = randA;\r\n bytes[8] = 0x80 | (randBHi >>> 24);\r\n bytes[9] = randBHi >>> 16;\r\n bytes[10] = randBHi >>> 8;\r\n bytes[11] = randBHi;\r\n bytes[12] = randBLo >>> 24;\r\n bytes[13] = randBLo >>> 16;\r\n bytes[14] = randBLo >>> 8;\r\n bytes[15] = randBLo;\r\n let text = \"\";\r\n for (let i = 0; i < bytes.length; i++) {\r\n text += UUID_CHARS.charAt(bytes[i] >>> 4);\r\n text += UUID_CHARS.charAt(bytes[i] & 0xf);\r\n if (i === 3 || i === 5 || i === 7 || i === 9) {\r\n text += \"-\";\r\n }\r\n }\r\n return text;\r\n}\r\n/**\r\n * Generates a keypair based on current keygen algorithm config.\r\n * @param extractable\r\n * @param usages\r\n */\r\nasync function generateKeyPair(extractable, usages) {\r\n return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);\r\n}\r\n/**\r\n * Export key as Json Web Key (JWK)\r\n * @param key\r\n */\r\nasync function exportJwk(key) {\r\n return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);\r\n}\r\n/**\r\n * Imports key as Json Web Key (JWK), can set extractable and usages.\r\n * @param key\r\n * @param extractable\r\n * @param usages\r\n */\r\nasync function importJwk(key, extractable, usages) {\r\n return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);\r\n}\r\n/**\r\n * Signs given data with given key\r\n * @param key\r\n * @param data\r\n */\r\nasync function sign(key, data) {\r\n return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);\r\n}\r\n/**\r\n * Generates symmetric base encryption key. This may be stored as all encryption/decryption keys will be derived from this one.\r\n */\r\nasync function generateBaseKey() {\r\n const key = await window.crypto.subtle.generateKey({\r\n name: AES_GCM,\r\n length: 256,\r\n }, true, [ENCRYPT, DECRYPT]);\r\n return window.crypto.subtle.exportKey(RAW, key);\r\n}\r\n/**\r\n * Returns the raw key to be passed into the key derivation function\r\n * @param baseKey\r\n * @returns\r\n */\r\nasync function generateHKDF(baseKey) {\r\n return window.crypto.subtle.importKey(RAW, baseKey, HKDF, false, [\r\n DERIVE_KEY,\r\n ]);\r\n}\r\n/**\r\n * Given a base key and a nonce generates a derived key to be used in encryption and decryption.\r\n * Note: every time we encrypt a new key is derived\r\n * @param baseKey\r\n * @param nonce\r\n * @returns\r\n */\r\nasync function deriveKey(baseKey, nonce, context) {\r\n return window.crypto.subtle.deriveKey({\r\n name: HKDF,\r\n salt: nonce,\r\n hash: S256_HASH_ALG,\r\n info: new TextEncoder().encode(context),\r\n }, baseKey, { name: AES_GCM, length: 256 }, false, [ENCRYPT, DECRYPT]);\r\n}\r\n/**\r\n * Encrypt the given data given a base key. Returns encrypted data and a nonce that must be provided during decryption\r\n * @param key\r\n * @param rawData\r\n */\r\nasync function encrypt(baseKey, rawData, context) {\r\n const encodedData = new TextEncoder().encode(rawData);\r\n // The nonce must never be reused with a given key.\r\n const nonce = window.crypto.getRandomValues(new Uint8Array(16));\r\n const derivedKey = await deriveKey(baseKey, nonce, context);\r\n const encryptedData = await window.crypto.subtle.encrypt({\r\n name: AES_GCM,\r\n iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce\r\n }, derivedKey, encodedData);\r\n return {\r\n data: urlEncodeArr(new Uint8Array(encryptedData)),\r\n nonce: urlEncodeArr(nonce),\r\n };\r\n}\r\n/**\r\n * Decrypt data with the given key and nonce\r\n * @param key\r\n * @param nonce\r\n * @param encryptedData\r\n * @returns\r\n */\r\nasync function decrypt(baseKey, nonce, context, encryptedData) {\r\n const encodedData = base64DecToArr(encryptedData);\r\n const derivedKey = await deriveKey(baseKey, base64DecToArr(nonce), context);\r\n const decryptedData = await window.crypto.subtle.decrypt({\r\n name: AES_GCM,\r\n iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce\r\n }, derivedKey, encodedData);\r\n return new TextDecoder().decode(decryptedData);\r\n}\r\n/**\r\n * Returns the SHA-256 hash of an input string\r\n * @param plainText\r\n */\r\nasync function hashString(plainText) {\r\n const hashBuffer = await sha256Digest(plainText);\r\n const hashBytes = new Uint8Array(hashBuffer);\r\n return urlEncodeArr(hashBytes);\r\n}\n\nexport { createNewGuid, decrypt, encrypt, exportJwk, generateBaseKey, generateHKDF, generateKeyPair, getRandomValues, hashString, importJwk, sha256Digest, sign, validateCryptoAvailable };\n//# sourceMappingURL=BrowserCrypto.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst storageNotSupported = \"storage_not_supported\";\r\nconst stubbedPublicClientApplicationCalled = \"stubbed_public_client_application_called\";\r\nconst inMemRedirectUnavailable = \"in_mem_redirect_unavailable\";\n\nexport { inMemRedirectUnavailable, storageNotSupported, stubbedPublicClientApplicationCalled };\n//# sourceMappingURL=BrowserConfigurationAuthErrorCodes.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AuthError } from '@azure/msal-common/browser';\nimport { storageNotSupported, stubbedPublicClientApplicationCalled, inMemRedirectUnavailable } from './BrowserConfigurationAuthErrorCodes.mjs';\nimport * as BrowserConfigurationAuthErrorCodes from './BrowserConfigurationAuthErrorCodes.mjs';\nexport { BrowserConfigurationAuthErrorCodes };\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst BrowserConfigurationAuthErrorMessages = {\r\n [storageNotSupported]: \"Given storage configuration option was not supported.\",\r\n [stubbedPublicClientApplicationCalled]: \"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors\",\r\n [inMemRedirectUnavailable]: \"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.\",\r\n};\r\n/**\r\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\r\n * @deprecated Use BrowserAuthErrorCodes instead\r\n */\r\nconst BrowserConfigurationAuthErrorMessage = {\r\n storageNotSupportedError: {\r\n code: storageNotSupported,\r\n desc: BrowserConfigurationAuthErrorMessages[storageNotSupported],\r\n },\r\n stubPcaInstanceCalled: {\r\n code: stubbedPublicClientApplicationCalled,\r\n desc: BrowserConfigurationAuthErrorMessages[stubbedPublicClientApplicationCalled],\r\n },\r\n inMemRedirectUnavailable: {\r\n code: inMemRedirectUnavailable,\r\n desc: BrowserConfigurationAuthErrorMessages[inMemRedirectUnavailable],\r\n },\r\n};\r\n/**\r\n * Browser library error class thrown by the MSAL.js library for SPAs\r\n */\r\nclass BrowserConfigurationAuthError extends AuthError {\r\n constructor(errorCode, errorMessage) {\r\n super(errorCode, errorMessage);\r\n this.name = \"BrowserConfigurationAuthError\";\r\n Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);\r\n }\r\n}\r\nfunction createBrowserConfigurationAuthError(errorCode) {\r\n return new BrowserConfigurationAuthError(errorCode, BrowserConfigurationAuthErrorMessages[errorCode]);\r\n}\n\nexport { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage, BrowserConfigurationAuthErrorMessages, createBrowserConfigurationAuthError };\n//# sourceMappingURL=BrowserConfigurationAuthError.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { UrlString } from '@azure/msal-common/browser';\nexport { invoke, invokeAsync } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { BrowserConstants, BrowserCacheLocation } from './BrowserConstants.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { blockIframeReload, redirectInIframe, blockNestedPopups, nonBrowserEnvironment, uninitializedPublicClientApplication } from '../error/BrowserAuthErrorCodes.mjs';\nimport { inMemRedirectUnavailable } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Clears hash from window url.\r\n */\r\nfunction clearHash(contentWindow) {\r\n // Office.js sets history.replaceState to null\r\n contentWindow.location.hash = \"\";\r\n if (typeof contentWindow.history.replaceState === \"function\") {\r\n // Full removes \"#\" from url\r\n contentWindow.history.replaceState(null, \"\", `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`);\r\n }\r\n}\r\n/**\r\n * Replaces current hash with hash from provided url\r\n */\r\nfunction replaceHash(url) {\r\n const urlParts = url.split(\"#\");\r\n urlParts.shift(); // Remove part before the hash\r\n window.location.hash = urlParts.length > 0 ? urlParts.join(\"#\") : \"\";\r\n}\r\n/**\r\n * Returns boolean of whether the current window is in an iframe or not.\r\n */\r\nfunction isInIframe() {\r\n return window.parent !== window;\r\n}\r\n/**\r\n * Returns boolean of whether or not the current window is a popup opened by msal\r\n */\r\nfunction isInPopup() {\r\n return (typeof window !== \"undefined\" &&\r\n !!window.opener &&\r\n window.opener !== window &&\r\n typeof window.name === \"string\" &&\r\n window.name.indexOf(`${BrowserConstants.POPUP_NAME_PREFIX}.`) === 0);\r\n}\r\n// #endregion\r\n/**\r\n * Returns current window URL as redirect uri\r\n */\r\nfunction getCurrentUri() {\r\n return typeof window !== \"undefined\" && window.location\r\n ? window.location.href.split(\"?\")[0].split(\"#\")[0]\r\n : \"\";\r\n}\r\n/**\r\n * Gets the homepage url for the current window location.\r\n */\r\nfunction getHomepage() {\r\n const currentUrl = new UrlString(window.location.href);\r\n const urlComponents = currentUrl.getUrlComponents();\r\n return `${urlComponents.Protocol}//${urlComponents.HostNameAndPort}/`;\r\n}\r\n/**\r\n * Throws error if we have completed an auth and are\r\n * attempting another auth request inside an iframe.\r\n */\r\nfunction blockReloadInHiddenIframes() {\r\n const isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);\r\n // return an error if called from the hidden iframe created by the msal js silent calls\r\n if (isResponseHash && isInIframe()) {\r\n throw createBrowserAuthError(blockIframeReload);\r\n }\r\n}\r\n/**\r\n * Block redirect operations in iframes unless explicitly allowed\r\n * @param interactionType Interaction type for the request\r\n * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe\r\n */\r\nfunction blockRedirectInIframe(allowRedirectInIframe) {\r\n if (isInIframe() && !allowRedirectInIframe) {\r\n // If we are not in top frame, we shouldn't redirect. This is also handled by the service.\r\n throw createBrowserAuthError(redirectInIframe);\r\n }\r\n}\r\n/**\r\n * Block redirectUri loaded in popup from calling AcquireToken APIs\r\n */\r\nfunction blockAcquireTokenInPopups() {\r\n // Popups opened by msal popup APIs are given a name that starts with \"msal.\"\r\n if (isInPopup()) {\r\n throw createBrowserAuthError(blockNestedPopups);\r\n }\r\n}\r\n/**\r\n * Throws error if token requests are made in non-browser environment\r\n * @param isBrowserEnvironment Flag indicating if environment is a browser.\r\n */\r\nfunction blockNonBrowserEnvironment() {\r\n if (typeof window === \"undefined\") {\r\n throw createBrowserAuthError(nonBrowserEnvironment);\r\n }\r\n}\r\n/**\r\n * Throws error if initialize hasn't been called\r\n * @param initialized\r\n */\r\nfunction blockAPICallsBeforeInitialize(initialized) {\r\n if (!initialized) {\r\n throw createBrowserAuthError(uninitializedPublicClientApplication);\r\n }\r\n}\r\n/**\r\n * Helper to validate app environment before making an auth request\r\n * @param initialized\r\n */\r\nfunction preflightCheck(initialized) {\r\n // Block request if not in browser environment\r\n blockNonBrowserEnvironment();\r\n // Block auth requests inside a hidden iframe\r\n blockReloadInHiddenIframes();\r\n // Block redirectUri opened in a popup from calling MSAL APIs\r\n blockAcquireTokenInPopups();\r\n // Block token acquisition before initialize has been called\r\n blockAPICallsBeforeInitialize(initialized);\r\n}\r\n/**\r\n * Helper to validate app enviornment before making redirect request\r\n * @param initialized\r\n * @param config\r\n */\r\nfunction redirectPreflightCheck(initialized, config) {\r\n preflightCheck(initialized);\r\n blockRedirectInIframe(config.system.allowRedirectInIframe);\r\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\r\n if (config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\r\n !config.cache.storeAuthStateInCookie) {\r\n throw createBrowserConfigurationAuthError(inMemRedirectUnavailable);\r\n }\r\n}\r\n/**\r\n * Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request\r\n * @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com\r\n * @returns\r\n */\r\nfunction preconnect(authority) {\r\n const link = document.createElement(\"link\");\r\n link.rel = \"preconnect\";\r\n link.href = new URL(authority).origin;\r\n link.crossOrigin = \"anonymous\";\r\n document.head.appendChild(link);\r\n // The browser will close connection if not used within a few seconds, remove element from the header after 10s\r\n window.setTimeout(() => {\r\n try {\r\n document.head.removeChild(link);\r\n }\r\n catch { }\r\n }, 10000); // 10s Timeout\r\n}\r\n/**\r\n * Wrapper function that creates a UUID v7 from the current timestamp.\r\n * @returns {string}\r\n */\r\nfunction createGuid() {\r\n return createNewGuid();\r\n}\n\nexport { blockAPICallsBeforeInitialize, blockAcquireTokenInPopups, blockNonBrowserEnvironment, blockRedirectInIframe, blockReloadInHiddenIframes, clearHash, createGuid, getCurrentUri, getHomepage, isInIframe, isInPopup, preconnect, preflightCheck, redirectPreflightCheck, replaceHash };\n//# sourceMappingURL=BrowserUtils.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass NavigationClient {\r\n /**\r\n * Navigates to other pages within the same web application\r\n * @param url\r\n * @param options\r\n */\r\n navigateInternal(url, options) {\r\n return NavigationClient.defaultNavigateWindow(url, options);\r\n }\r\n /**\r\n * Navigates to other pages outside the web application i.e. the Identity Provider\r\n * @param url\r\n * @param options\r\n */\r\n navigateExternal(url, options) {\r\n return NavigationClient.defaultNavigateWindow(url, options);\r\n }\r\n /**\r\n * Default navigation implementation invoked by the internal and external functions\r\n * @param url\r\n * @param options\r\n */\r\n static defaultNavigateWindow(url, options) {\r\n if (options.noHistory) {\r\n window.location.replace(url);\r\n }\r\n else {\r\n window.location.assign(url);\r\n }\r\n return new Promise((resolve) => {\r\n setTimeout(() => {\r\n resolve(true);\r\n }, options.timeout);\r\n });\r\n }\r\n}\n\nexport { NavigationClient };\n//# sourceMappingURL=NavigationClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createNetworkError } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.mjs';\nimport { getRequestFailed, noNetworkConnectivity, failedToParseResponse, postRequestFailed, failedToBuildHeaders, failedToParseHeaders } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\r\n */\r\nclass FetchClient {\r\n /**\r\n * Fetch Client for REST endpoints - Get request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n async sendGetRequestAsync(url, options) {\r\n let response;\r\n let responseHeaders = {};\r\n let responseStatus = 0;\r\n const reqHeaders = getFetchHeaders(options);\r\n try {\r\n response = await fetch(url, {\r\n method: HTTP_REQUEST_TYPE.GET,\r\n headers: reqHeaders,\r\n });\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(window.navigator.onLine\r\n ? getRequestFailed\r\n : noNetworkConnectivity);\r\n }\r\n responseHeaders = getHeaderDict(response.headers);\r\n try {\r\n responseStatus = response.status;\r\n return {\r\n headers: responseHeaders,\r\n body: (await response.json()),\r\n status: responseStatus,\r\n };\r\n }\r\n catch (e) {\r\n throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);\r\n }\r\n }\r\n /**\r\n * Fetch Client for REST endpoints - Post request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n async sendPostRequestAsync(url, options) {\r\n const reqBody = (options && options.body) || \"\";\r\n const reqHeaders = getFetchHeaders(options);\r\n let response;\r\n let responseStatus = 0;\r\n let responseHeaders = {};\r\n try {\r\n response = await fetch(url, {\r\n method: HTTP_REQUEST_TYPE.POST,\r\n headers: reqHeaders,\r\n body: reqBody,\r\n });\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(window.navigator.onLine\r\n ? postRequestFailed\r\n : noNetworkConnectivity);\r\n }\r\n responseHeaders = getHeaderDict(response.headers);\r\n try {\r\n responseStatus = response.status;\r\n return {\r\n headers: responseHeaders,\r\n body: (await response.json()),\r\n status: responseStatus,\r\n };\r\n }\r\n catch (e) {\r\n throw createNetworkError(createBrowserAuthError(failedToParseResponse), responseStatus, responseHeaders);\r\n }\r\n }\r\n}\r\n/**\r\n * Get Fetch API Headers object from string map\r\n * @param inputHeaders\r\n */\r\nfunction getFetchHeaders(options) {\r\n try {\r\n const headers = new Headers();\r\n if (!(options && options.headers)) {\r\n return headers;\r\n }\r\n const optionsHeaders = options.headers;\r\n Object.entries(optionsHeaders).forEach(([key, value]) => {\r\n headers.append(key, value);\r\n });\r\n return headers;\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(failedToBuildHeaders);\r\n }\r\n}\r\n/**\r\n * Returns object representing response headers\r\n * @param headers\r\n * @returns\r\n */\r\nfunction getHeaderDict(headers) {\r\n try {\r\n const headerDict = {};\r\n headers.forEach((value, key) => {\r\n headerDict[key] = value;\r\n });\r\n return headerDict;\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(failedToParseHeaders);\r\n }\r\n}\n\nexport { FetchClient };\n//# sourceMappingURL=FetchClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { Constants, ProtocolMode, ServerResponseType, AzureCloudInstance, StubPerformanceClient, Logger, createClientConfigurationError, ClientConfigurationErrorCodes, LogLevel, DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule } from '@azure/msal-common/browser';\nimport { BrowserCacheLocation, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { NavigationClient } from '../navigation/NavigationClient.mjs';\nimport { FetchClient } from '../network/FetchClient.mjs';\nimport { getCurrentUri } from '../utils/BrowserUtils.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Default timeout for popup windows and iframes in milliseconds\r\nconst DEFAULT_POPUP_TIMEOUT_MS = 60000;\r\nconst DEFAULT_IFRAME_TIMEOUT_MS = 10000;\r\nconst DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\r\nconst DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\r\n/**\r\n * MSAL function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param auth\r\n * @param cache\r\n * @param system\r\n *\r\n * @returns Configuration object\r\n */\r\nfunction buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry, }, isBrowserEnvironment) {\r\n // Default auth options for browser\r\n const DEFAULT_AUTH_OPTIONS = {\r\n clientId: Constants.EMPTY_STRING,\r\n authority: `${Constants.DEFAULT_AUTHORITY}`,\r\n knownAuthorities: [],\r\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\r\n authorityMetadata: Constants.EMPTY_STRING,\r\n redirectUri: typeof window !== \"undefined\" ? getCurrentUri() : \"\",\r\n postLogoutRedirectUri: Constants.EMPTY_STRING,\r\n navigateToLoginRequestUrl: true,\r\n clientCapabilities: [],\r\n protocolMode: ProtocolMode.AAD,\r\n OIDCOptions: {\r\n serverResponseType: ServerResponseType.FRAGMENT,\r\n defaultScopes: [\r\n Constants.OPENID_SCOPE,\r\n Constants.PROFILE_SCOPE,\r\n Constants.OFFLINE_ACCESS_SCOPE,\r\n ],\r\n },\r\n azureCloudOptions: {\r\n azureCloudInstance: AzureCloudInstance.None,\r\n tenant: Constants.EMPTY_STRING,\r\n },\r\n skipAuthorityMetadataCache: false,\r\n supportsNestedAppAuth: false,\r\n instanceAware: false,\r\n };\r\n // Default cache options for browser\r\n const DEFAULT_CACHE_OPTIONS = {\r\n cacheLocation: BrowserCacheLocation.SessionStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.SessionStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage\r\n cacheMigrationEnabled: userInputCache &&\r\n userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage\r\n ? true\r\n : false,\r\n claimsBasedCachingEnabled: false,\r\n };\r\n // Default logger options for browser\r\n const DEFAULT_LOGGER_OPTIONS = {\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n loggerCallback: () => {\r\n // allow users to not set logger call back\r\n },\r\n logLevel: LogLevel.Info,\r\n piiLoggingEnabled: false,\r\n };\r\n // Default system options for browser\r\n const DEFAULT_BROWSER_SYSTEM_OPTIONS = {\r\n ...DEFAULT_SYSTEM_OPTIONS,\r\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\r\n networkClient: isBrowserEnvironment\r\n ? new FetchClient()\r\n : StubbedNetworkModule,\r\n navigationClient: new NavigationClient(),\r\n loadFrameTimeout: 0,\r\n // If loadFrameTimeout is provided, use that as default.\r\n windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,\r\n iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,\r\n navigateFrameWait: 0,\r\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\r\n asyncPopups: false,\r\n allowRedirectInIframe: false,\r\n allowPlatformBroker: false,\r\n nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||\r\n DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,\r\n pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,\r\n };\r\n const providedSystemOptions = {\r\n ...DEFAULT_BROWSER_SYSTEM_OPTIONS,\r\n ...userInputSystem,\r\n loggerOptions: userInputSystem?.loggerOptions || DEFAULT_LOGGER_OPTIONS,\r\n };\r\n const DEFAULT_TELEMETRY_OPTIONS = {\r\n application: {\r\n appName: Constants.EMPTY_STRING,\r\n appVersion: Constants.EMPTY_STRING,\r\n },\r\n client: new StubPerformanceClient(),\r\n };\r\n // Throw an error if user has set OIDCOptions without being in OIDC protocol mode\r\n if (userInputAuth?.protocolMode !== ProtocolMode.OIDC &&\r\n userInputAuth?.OIDCOptions) {\r\n const logger = new Logger(providedSystemOptions.loggerOptions);\r\n logger.warning(JSON.stringify(createClientConfigurationError(ClientConfigurationErrorCodes.cannotSetOIDCOptions)));\r\n }\r\n // Throw an error if user has set allowPlatformBroker to true without being in AAD protocol mode\r\n if (userInputAuth?.protocolMode &&\r\n userInputAuth.protocolMode !== ProtocolMode.AAD &&\r\n providedSystemOptions?.allowPlatformBroker) {\r\n throw createClientConfigurationError(ClientConfigurationErrorCodes.cannotAllowPlatformBroker);\r\n }\r\n const overlayedConfig = {\r\n auth: {\r\n ...DEFAULT_AUTH_OPTIONS,\r\n ...userInputAuth,\r\n OIDCOptions: {\r\n ...DEFAULT_AUTH_OPTIONS.OIDCOptions,\r\n ...userInputAuth?.OIDCOptions,\r\n },\r\n },\r\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\r\n system: providedSystemOptions,\r\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },\r\n };\r\n return overlayedConfig;\r\n}\n\nexport { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };\n//# sourceMappingURL=Configuration.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/* eslint-disable header/header */\r\nconst name = \"@azure/msal-browser\";\r\nconst version = \"4.8.0\";\n\nexport { name, version };\n//# sourceMappingURL=packageMetadata.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { LogLevel, Logger } from '@azure/msal-common/browser';\nimport { buildConfiguration } from '../config/Configuration.mjs';\nimport { name, version } from '../packageMetadata.mjs';\nimport { BrowserCacheLocation, LOG_LEVEL_CACHE_KEY, LOG_PII_CACHE_KEY } from '../utils/BrowserConstants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Base class for operating context\r\n * Operating contexts are contexts in which MSAL.js is being run\r\n * More than one operating context may be available at a time\r\n * It's important from a logging and telemetry point of view for us to be able to identify the operating context.\r\n * For example: Some operating contexts will pre-cache tokens impacting performance telemetry\r\n */\r\nclass BaseOperatingContext {\r\n static loggerCallback(level, message) {\r\n switch (level) {\r\n case LogLevel.Error:\r\n // eslint-disable-next-line no-console\r\n console.error(message);\r\n return;\r\n case LogLevel.Info:\r\n // eslint-disable-next-line no-console\r\n console.info(message);\r\n return;\r\n case LogLevel.Verbose:\r\n // eslint-disable-next-line no-console\r\n console.debug(message);\r\n return;\r\n case LogLevel.Warning:\r\n // eslint-disable-next-line no-console\r\n console.warn(message);\r\n return;\r\n default:\r\n // eslint-disable-next-line no-console\r\n console.log(message);\r\n return;\r\n }\r\n }\r\n constructor(config) {\r\n /*\r\n * If loaded in an environment where window is not available,\r\n * set internal flag to false so that further requests fail.\r\n * This is to support server-side rendering environments.\r\n */\r\n this.browserEnvironment = typeof window !== \"undefined\";\r\n this.config = buildConfiguration(config, this.browserEnvironment);\r\n let sessionStorage;\r\n try {\r\n sessionStorage = window[BrowserCacheLocation.SessionStorage];\r\n // Mute errors if it's a non-browser environment or cookies are blocked.\r\n }\r\n catch (e) { }\r\n const logLevelKey = sessionStorage?.getItem(LOG_LEVEL_CACHE_KEY);\r\n const piiLoggingKey = sessionStorage\r\n ?.getItem(LOG_PII_CACHE_KEY)\r\n ?.toLowerCase();\r\n const piiLoggingEnabled = piiLoggingKey === \"true\"\r\n ? true\r\n : piiLoggingKey === \"false\"\r\n ? false\r\n : undefined;\r\n const loggerOptions = { ...this.config.system.loggerOptions };\r\n const logLevel = logLevelKey && Object.keys(LogLevel).includes(logLevelKey)\r\n ? LogLevel[logLevelKey]\r\n : undefined;\r\n if (logLevel) {\r\n loggerOptions.loggerCallback = BaseOperatingContext.loggerCallback;\r\n loggerOptions.logLevel = logLevel;\r\n }\r\n if (piiLoggingEnabled !== undefined) {\r\n loggerOptions.piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n this.logger = new Logger(loggerOptions, name, version);\r\n this.available = false;\r\n }\r\n /**\r\n * Return the MSAL config\r\n * @returns BrowserConfiguration\r\n */\r\n getConfig() {\r\n return this.config;\r\n }\r\n /**\r\n * Returns the MSAL Logger\r\n * @returns Logger\r\n */\r\n getLogger() {\r\n return this.logger;\r\n }\r\n isAvailable() {\r\n return this.available;\r\n }\r\n isBrowserEnvironment() {\r\n return this.browserEnvironment;\r\n }\r\n}\n\nexport { BaseOperatingContext };\n//# sourceMappingURL=BaseOperatingContext.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { BaseOperatingContext } from './BaseOperatingContext.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass StandardOperatingContext extends BaseOperatingContext {\r\n /**\r\n * Return the module name. Intended for use with import() to enable dynamic import\r\n * of the implementation associated with this operating context\r\n * @returns\r\n */\r\n getModuleName() {\r\n return StandardOperatingContext.MODULE_NAME;\r\n }\r\n /**\r\n * Returns the unique identifier for this operating context\r\n * @returns string\r\n */\r\n getId() {\r\n return StandardOperatingContext.ID;\r\n }\r\n /**\r\n * Checks whether the operating context is available.\r\n * Confirms that the code is running a browser rather. This is required.\r\n * @returns Promise indicating whether this operating context is currently available.\r\n */\r\n async initialize() {\r\n this.available = typeof window !== \"undefined\";\r\n return this.available;\r\n /*\r\n * NOTE: The standard context is available as long as there is a window. If/when we split out WAM from Browser\r\n * We can move the current contents of the initialize method to here and verify that the WAM extension is available\r\n */\r\n }\r\n}\r\n/*\r\n * TODO: Once we have determine the bundling code return here to specify the name of the bundle\r\n * containing the implementation for this operating context\r\n */\r\nStandardOperatingContext.MODULE_NAME = \"\";\r\n/**\r\n * Unique identifier for the operating context\r\n */\r\nStandardOperatingContext.ID = \"StandardOperatingContext\";\n\nexport { StandardOperatingContext };\n//# sourceMappingURL=StandardOperatingContext.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { DB_NAME, DB_VERSION, DB_TABLE_NAME } from '../utils/BrowserConstants.mjs';\nimport { databaseUnavailable, databaseNotOpen } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\r\n */\r\nclass DatabaseStorage {\r\n constructor() {\r\n this.dbName = DB_NAME;\r\n this.version = DB_VERSION;\r\n this.tableName = DB_TABLE_NAME;\r\n this.dbOpen = false;\r\n }\r\n /**\r\n * Opens IndexedDB instance.\r\n */\r\n async open() {\r\n return new Promise((resolve, reject) => {\r\n const openDB = window.indexedDB.open(this.dbName, this.version);\r\n openDB.addEventListener(\"upgradeneeded\", (e) => {\r\n const event = e;\r\n event.target.result.createObjectStore(this.tableName);\r\n });\r\n openDB.addEventListener(\"success\", (e) => {\r\n const event = e;\r\n this.db = event.target.result;\r\n this.dbOpen = true;\r\n resolve();\r\n });\r\n openDB.addEventListener(\"error\", () => reject(createBrowserAuthError(databaseUnavailable)));\r\n });\r\n }\r\n /**\r\n * Closes the connection to IndexedDB database when all pending transactions\r\n * complete.\r\n */\r\n closeConnection() {\r\n const db = this.db;\r\n if (db && this.dbOpen) {\r\n db.close();\r\n this.dbOpen = false;\r\n }\r\n }\r\n /**\r\n * Opens database if it's not already open\r\n */\r\n async validateDbIsOpen() {\r\n if (!this.dbOpen) {\r\n return this.open();\r\n }\r\n }\r\n /**\r\n * Retrieves item from IndexedDB instance.\r\n * @param key\r\n */\r\n async getItem(key) {\r\n await this.validateDbIsOpen();\r\n return new Promise((resolve, reject) => {\r\n // TODO: Add timeouts?\r\n if (!this.db) {\r\n return reject(createBrowserAuthError(databaseNotOpen));\r\n }\r\n const transaction = this.db.transaction([this.tableName], \"readonly\");\r\n const objectStore = transaction.objectStore(this.tableName);\r\n const dbGet = objectStore.get(key);\r\n dbGet.addEventListener(\"success\", (e) => {\r\n const event = e;\r\n this.closeConnection();\r\n resolve(event.target.result);\r\n });\r\n dbGet.addEventListener(\"error\", (e) => {\r\n this.closeConnection();\r\n reject(e);\r\n });\r\n });\r\n }\r\n /**\r\n * Adds item to IndexedDB under given key\r\n * @param key\r\n * @param payload\r\n */\r\n async setItem(key, payload) {\r\n await this.validateDbIsOpen();\r\n return new Promise((resolve, reject) => {\r\n // TODO: Add timeouts?\r\n if (!this.db) {\r\n return reject(createBrowserAuthError(databaseNotOpen));\r\n }\r\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\r\n const objectStore = transaction.objectStore(this.tableName);\r\n const dbPut = objectStore.put(payload, key);\r\n dbPut.addEventListener(\"success\", () => {\r\n this.closeConnection();\r\n resolve();\r\n });\r\n dbPut.addEventListener(\"error\", (e) => {\r\n this.closeConnection();\r\n reject(e);\r\n });\r\n });\r\n }\r\n /**\r\n * Removes item from IndexedDB under given key\r\n * @param key\r\n */\r\n async removeItem(key) {\r\n await this.validateDbIsOpen();\r\n return new Promise((resolve, reject) => {\r\n if (!this.db) {\r\n return reject(createBrowserAuthError(databaseNotOpen));\r\n }\r\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\r\n const objectStore = transaction.objectStore(this.tableName);\r\n const dbDelete = objectStore.delete(key);\r\n dbDelete.addEventListener(\"success\", () => {\r\n this.closeConnection();\r\n resolve();\r\n });\r\n dbDelete.addEventListener(\"error\", (e) => {\r\n this.closeConnection();\r\n reject(e);\r\n });\r\n });\r\n }\r\n /**\r\n * Get all the keys from the storage object as an iterable array of strings.\r\n */\r\n async getKeys() {\r\n await this.validateDbIsOpen();\r\n return new Promise((resolve, reject) => {\r\n if (!this.db) {\r\n return reject(createBrowserAuthError(databaseNotOpen));\r\n }\r\n const transaction = this.db.transaction([this.tableName], \"readonly\");\r\n const objectStore = transaction.objectStore(this.tableName);\r\n const dbGetKeys = objectStore.getAllKeys();\r\n dbGetKeys.addEventListener(\"success\", (e) => {\r\n const event = e;\r\n this.closeConnection();\r\n resolve(event.target.result);\r\n });\r\n dbGetKeys.addEventListener(\"error\", (e) => {\r\n this.closeConnection();\r\n reject(e);\r\n });\r\n });\r\n }\r\n /**\r\n *\r\n * Checks whether there is an object under the search key in the object store\r\n */\r\n async containsKey(key) {\r\n await this.validateDbIsOpen();\r\n return new Promise((resolve, reject) => {\r\n if (!this.db) {\r\n return reject(createBrowserAuthError(databaseNotOpen));\r\n }\r\n const transaction = this.db.transaction([this.tableName], \"readonly\");\r\n const objectStore = transaction.objectStore(this.tableName);\r\n const dbContainsKey = objectStore.count(key);\r\n dbContainsKey.addEventListener(\"success\", (e) => {\r\n const event = e;\r\n this.closeConnection();\r\n resolve(event.target.result === 1);\r\n });\r\n dbContainsKey.addEventListener(\"error\", (e) => {\r\n this.closeConnection();\r\n reject(e);\r\n });\r\n });\r\n }\r\n /**\r\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\r\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\r\n * with IndexedDB database versions.\r\n */\r\n async deleteDatabase() {\r\n // Check if database being deleted exists\r\n if (this.db && this.dbOpen) {\r\n this.closeConnection();\r\n }\r\n return new Promise((resolve, reject) => {\r\n const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\r\n const id = setTimeout(() => reject(false), 200); // Reject if events aren't raised within 200ms\r\n deleteDbRequest.addEventListener(\"success\", () => {\r\n clearTimeout(id);\r\n return resolve(true);\r\n });\r\n deleteDbRequest.addEventListener(\"blocked\", () => {\r\n clearTimeout(id);\r\n return resolve(true);\r\n });\r\n deleteDbRequest.addEventListener(\"error\", () => {\r\n clearTimeout(id);\r\n return reject(false);\r\n });\r\n });\r\n }\r\n}\n\nexport { DatabaseStorage };\n//# sourceMappingURL=DatabaseStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass MemoryStorage {\r\n constructor() {\r\n this.cache = new Map();\r\n }\r\n async initialize() {\r\n // Memory storage does not require initialization\r\n }\r\n getItem(key) {\r\n return this.cache.get(key) || null;\r\n }\r\n getUserData(key) {\r\n return this.getItem(key);\r\n }\r\n setItem(key, value) {\r\n this.cache.set(key, value);\r\n }\r\n async setUserData(key, value) {\r\n this.setItem(key, value);\r\n }\r\n removeItem(key) {\r\n this.cache.delete(key);\r\n }\r\n getKeys() {\r\n const cacheKeys = [];\r\n this.cache.forEach((value, key) => {\r\n cacheKeys.push(key);\r\n });\r\n return cacheKeys;\r\n }\r\n containsKey(key) {\r\n return this.cache.has(key);\r\n }\r\n clear() {\r\n this.cache.clear();\r\n }\r\n}\n\nexport { MemoryStorage };\n//# sourceMappingURL=MemoryStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { BrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { DatabaseStorage } from './DatabaseStorage.mjs';\nimport { MemoryStorage } from './MemoryStorage.mjs';\nimport { databaseUnavailable } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,\r\n * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.\r\n */\r\nclass AsyncMemoryStorage {\r\n constructor(logger) {\r\n this.inMemoryCache = new MemoryStorage();\r\n this.indexedDBCache = new DatabaseStorage();\r\n this.logger = logger;\r\n }\r\n handleDatabaseAccessError(error) {\r\n if (error instanceof BrowserAuthError &&\r\n error.errorCode === databaseUnavailable) {\r\n this.logger.error(\"Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.\");\r\n }\r\n else {\r\n throw error;\r\n }\r\n }\r\n /**\r\n * Get the item matching the given key. Tries in-memory cache first, then in the asynchronous\r\n * storage object if item isn't found in-memory.\r\n * @param key\r\n */\r\n async getItem(key) {\r\n const item = this.inMemoryCache.getItem(key);\r\n if (!item) {\r\n try {\r\n this.logger.verbose(\"Queried item not found in in-memory cache, now querying persistent storage.\");\r\n return await this.indexedDBCache.getItem(key);\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n }\r\n }\r\n return item;\r\n }\r\n /**\r\n * Sets the item in the in-memory cache and then tries to set it in the asynchronous\r\n * storage object with the given key.\r\n * @param key\r\n * @param value\r\n */\r\n async setItem(key, value) {\r\n this.inMemoryCache.setItem(key, value);\r\n try {\r\n await this.indexedDBCache.setItem(key, value);\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n }\r\n }\r\n /**\r\n * Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.\r\n * @param key\r\n */\r\n async removeItem(key) {\r\n this.inMemoryCache.removeItem(key);\r\n try {\r\n await this.indexedDBCache.removeItem(key);\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n }\r\n }\r\n /**\r\n * Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the\r\n * asynchronous storage object.\r\n */\r\n async getKeys() {\r\n const cacheKeys = this.inMemoryCache.getKeys();\r\n if (cacheKeys.length === 0) {\r\n try {\r\n this.logger.verbose(\"In-memory cache is empty, now querying persistent storage.\");\r\n return await this.indexedDBCache.getKeys();\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n }\r\n }\r\n return cacheKeys;\r\n }\r\n /**\r\n * Returns true or false if the given key is present in the cache.\r\n * @param key\r\n */\r\n async containsKey(key) {\r\n const containsKey = this.inMemoryCache.containsKey(key);\r\n if (!containsKey) {\r\n try {\r\n this.logger.verbose(\"Key not found in in-memory cache, now querying persistent storage.\");\r\n return await this.indexedDBCache.containsKey(key);\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n }\r\n }\r\n return containsKey;\r\n }\r\n /**\r\n * Clears in-memory Map\r\n */\r\n clearInMemory() {\r\n // InMemory cache is a Map instance, clear is straightforward\r\n this.logger.verbose(`Deleting in-memory keystore`);\r\n this.inMemoryCache.clear();\r\n this.logger.verbose(`In-memory keystore deleted`);\r\n }\r\n /**\r\n * Tries to delete the IndexedDB database\r\n * @returns\r\n */\r\n async clearPersistent() {\r\n try {\r\n this.logger.verbose(\"Deleting persistent keystore\");\r\n const dbDeleted = await this.indexedDBCache.deleteDatabase();\r\n if (dbDeleted) {\r\n this.logger.verbose(\"Persistent keystore deleted\");\r\n }\r\n return dbDeleted;\r\n }\r\n catch (e) {\r\n this.handleDatabaseAccessError(e);\r\n return false;\r\n }\r\n }\r\n}\n\nexport { AsyncMemoryStorage };\n//# sourceMappingURL=AsyncMemoryStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, JoseHeader } from '@azure/msal-common/browser';\nimport { base64Encode, urlEncode, urlEncodeArr } from '../encode/Base64Encode.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { validateCryptoAvailable, createNewGuid, generateKeyPair, exportJwk, importJwk, sign, hashString } from './BrowserCrypto.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { AsyncMemoryStorage } from '../cache/AsyncMemoryStorage.mjs';\nimport { cryptoKeyNotFound } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and\r\n * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).\r\n */\r\nclass CryptoOps {\r\n constructor(logger, performanceClient, skipValidateSubtleCrypto) {\r\n this.logger = logger;\r\n // Browser crypto needs to be validated first before any other classes can be set.\r\n validateCryptoAvailable(skipValidateSubtleCrypto ?? false);\r\n this.cache = new AsyncMemoryStorage(this.logger);\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Creates a new random GUID - used to populate state and nonce.\r\n * @returns string (GUID)\r\n */\r\n createNewGuid() {\r\n return createNewGuid();\r\n }\r\n /**\r\n * Encodes input string to base64.\r\n * @param input\r\n */\r\n base64Encode(input) {\r\n return base64Encode(input);\r\n }\r\n /**\r\n * Decodes input string from base64.\r\n * @param input\r\n */\r\n base64Decode(input) {\r\n return base64Decode(input);\r\n }\r\n /**\r\n * Encodes input string to base64 URL safe string.\r\n * @param input\r\n */\r\n base64UrlEncode(input) {\r\n return urlEncode(input);\r\n }\r\n /**\r\n * Stringifies and base64Url encodes input public key\r\n * @param inputKid\r\n * @returns Base64Url encoded public key\r\n */\r\n encodeKid(inputKid) {\r\n return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));\r\n }\r\n /**\r\n * Generates a keypair, stores it and returns a thumbprint\r\n * @param request\r\n */\r\n async getPublicKeyThumbprint(request) {\r\n const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);\r\n // Generate Keypair\r\n const keyPair = await generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);\r\n // Generate Thumbprint for Public Key\r\n const publicKeyJwk = await exportJwk(keyPair.publicKey);\r\n const pubKeyThumprintObj = {\r\n e: publicKeyJwk.e,\r\n kty: publicKeyJwk.kty,\r\n n: publicKeyJwk.n,\r\n };\r\n const publicJwkString = getSortedObjectString(pubKeyThumprintObj);\r\n const publicJwkHash = await this.hashString(publicJwkString);\r\n // Generate Thumbprint for Private Key\r\n const privateKeyJwk = await exportJwk(keyPair.privateKey);\r\n // Re-import private key to make it unextractable\r\n const unextractablePrivateKey = await importJwk(privateKeyJwk, false, [\"sign\"]);\r\n // Store Keypair data in keystore\r\n await this.cache.setItem(publicJwkHash, {\r\n privateKey: unextractablePrivateKey,\r\n publicKey: keyPair.publicKey,\r\n requestMethod: request.resourceRequestMethod,\r\n requestUri: request.resourceRequestUri,\r\n });\r\n if (publicKeyThumbMeasurement) {\r\n publicKeyThumbMeasurement.end({\r\n success: true,\r\n });\r\n }\r\n return publicJwkHash;\r\n }\r\n /**\r\n * Removes cryptographic keypair from key store matching the keyId passed in\r\n * @param kid\r\n */\r\n async removeTokenBindingKey(kid) {\r\n await this.cache.removeItem(kid);\r\n const keyFound = await this.cache.containsKey(kid);\r\n return !keyFound;\r\n }\r\n /**\r\n * Removes all cryptographic keys from IndexedDB storage\r\n */\r\n async clearKeystore() {\r\n // Delete in-memory keystores\r\n this.cache.clearInMemory();\r\n /**\r\n * There is only one database, so calling clearPersistent on asymmetric keystore takes care of\r\n * every persistent keystore\r\n */\r\n try {\r\n await this.cache.clearPersistent();\r\n return true;\r\n }\r\n catch (e) {\r\n if (e instanceof Error) {\r\n this.logger.error(`Clearing keystore failed with error: ${e.message}`);\r\n }\r\n else {\r\n this.logger.error(\"Clearing keystore failed with unknown error\");\r\n }\r\n return false;\r\n }\r\n }\r\n /**\r\n * Signs the given object as a jwt payload with private key retrieved by given kid.\r\n * @param payload\r\n * @param kid\r\n */\r\n async signJwt(payload, kid, shrOptions, correlationId) {\r\n const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);\r\n const cachedKeyPair = await this.cache.getItem(kid);\r\n if (!cachedKeyPair) {\r\n throw createBrowserAuthError(cryptoKeyNotFound);\r\n }\r\n // Get public key as JWK\r\n const publicKeyJwk = await exportJwk(cachedKeyPair.publicKey);\r\n const publicKeyJwkString = getSortedObjectString(publicKeyJwk);\r\n // Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: \"FULL_PUBLIC_KEY_HASH\" })\r\n const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));\r\n // Generate header\r\n const shrHeader = JoseHeader.getShrHeaderString({\r\n ...shrOptions?.header,\r\n alg: publicKeyJwk.alg,\r\n kid: encodedKeyIdThumbprint,\r\n });\r\n const encodedShrHeader = urlEncode(shrHeader);\r\n // Generate payload\r\n payload.cnf = {\r\n jwk: JSON.parse(publicKeyJwkString),\r\n };\r\n const encodedPayload = urlEncode(JSON.stringify(payload));\r\n // Form token string\r\n const tokenString = `${encodedShrHeader}.${encodedPayload}`;\r\n // Sign token\r\n const encoder = new TextEncoder();\r\n const tokenBuffer = encoder.encode(tokenString);\r\n const signatureBuffer = await sign(cachedKeyPair.privateKey, tokenBuffer);\r\n const encodedSignature = urlEncodeArr(new Uint8Array(signatureBuffer));\r\n const signedJwt = `${tokenString}.${encodedSignature}`;\r\n if (signJwtMeasurement) {\r\n signJwtMeasurement.end({\r\n success: true,\r\n });\r\n }\r\n return signedJwt;\r\n }\r\n /**\r\n * Returns the SHA-256 hash of an input string\r\n * @param plainText\r\n */\r\n async hashString(plainText) {\r\n return hashString(plainText);\r\n }\r\n}\r\nCryptoOps.POP_KEY_USAGES = [\"sign\", \"verify\"];\r\nCryptoOps.EXTRACTABLE = true;\r\nfunction getSortedObjectString(obj) {\r\n return JSON.stringify(obj, Object.keys(obj).sort());\r\n}\n\nexport { CryptoOps };\n//# sourceMappingURL=CryptoOps.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common/browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Cookie life calculation (hours * minutes * seconds * ms)\r\nconst COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;\r\nconst SameSiteOptions = {\r\n Lax: \"Lax\",\r\n None: \"None\",\r\n};\r\nclass CookieStorage {\r\n initialize() {\r\n return Promise.resolve();\r\n }\r\n getItem(key) {\r\n const name = `${encodeURIComponent(key)}`;\r\n const cookieList = document.cookie.split(\";\");\r\n for (let i = 0; i < cookieList.length; i++) {\r\n const cookie = cookieList[i];\r\n const [key, ...rest] = decodeURIComponent(cookie).trim().split(\"=\");\r\n const value = rest.join(\"=\");\r\n if (key === name) {\r\n return value;\r\n }\r\n }\r\n return \"\";\r\n }\r\n getUserData() {\r\n throw createClientAuthError(ClientAuthErrorCodes.methodNotImplemented);\r\n }\r\n setItem(key, value, cookieLifeDays, secure = true, sameSite = SameSiteOptions.Lax) {\r\n let cookieStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)};path=/;SameSite=${sameSite};`;\r\n if (cookieLifeDays) {\r\n const expireTime = getCookieExpirationTime(cookieLifeDays);\r\n cookieStr += `expires=${expireTime};`;\r\n }\r\n if (secure || sameSite === SameSiteOptions.None) {\r\n // SameSite None requires Secure flag\r\n cookieStr += \"Secure;\";\r\n }\r\n document.cookie = cookieStr;\r\n }\r\n async setUserData() {\r\n return Promise.reject(createClientAuthError(ClientAuthErrorCodes.methodNotImplemented));\r\n }\r\n removeItem(key) {\r\n // Setting expiration to -1 removes it\r\n this.setItem(key, \"\", -1);\r\n }\r\n getKeys() {\r\n const cookieList = document.cookie.split(\";\");\r\n const keys = [];\r\n cookieList.forEach((cookie) => {\r\n const cookieParts = decodeURIComponent(cookie).trim().split(\"=\");\r\n keys.push(cookieParts[0]);\r\n });\r\n return keys;\r\n }\r\n containsKey(key) {\r\n return this.getKeys().includes(key);\r\n }\r\n}\r\n/**\r\n * Get cookie expiration time\r\n * @param cookieLifeDays\r\n */\r\nfunction getCookieExpirationTime(cookieLifeDays) {\r\n const today = new Date();\r\n const expr = new Date(today.getTime() + cookieLifeDays * COOKIE_LIFE_MULTIPLIER);\r\n return expr.toUTCString();\r\n}\n\nexport { CookieStorage, SameSiteOptions, getCookieExpirationTime };\n//# sourceMappingURL=CookieStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { StaticCacheKeys } from '../utils/BrowserConstants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns a list of cache keys for all known accounts\r\n * @param storage\r\n * @returns\r\n */\r\nfunction getAccountKeys(storage) {\r\n const accountKeys = storage.getItem(StaticCacheKeys.ACCOUNT_KEYS);\r\n if (accountKeys) {\r\n return JSON.parse(accountKeys);\r\n }\r\n return [];\r\n}\r\n/**\r\n * Returns a list of cache keys for all known tokens\r\n * @param clientId\r\n * @param storage\r\n * @returns\r\n */\r\nfunction getTokenKeys(clientId, storage) {\r\n const item = storage.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${clientId}`);\r\n if (item) {\r\n const tokenKeys = JSON.parse(item);\r\n if (tokenKeys &&\r\n tokenKeys.hasOwnProperty(\"idToken\") &&\r\n tokenKeys.hasOwnProperty(\"accessToken\") &&\r\n tokenKeys.hasOwnProperty(\"refreshToken\")) {\r\n return tokenKeys;\r\n }\r\n }\r\n return {\r\n idToken: [],\r\n accessToken: [],\r\n refreshToken: [],\r\n };\r\n}\n\nexport { getAccountKeys, getTokenKeys };\n//# sourceMappingURL=CacheHelpers.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { invoke, PerformanceEvents, invokeAsync, Constants } from '@azure/msal-common/browser';\nimport { generateHKDF, createNewGuid, generateBaseKey, encrypt, decrypt } from '../crypto/BrowserCrypto.mjs';\nimport { base64DecToArr } from '../encode/Base64Decode.mjs';\nimport { urlEncodeArr } from '../encode/Base64Encode.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { SameSiteOptions, CookieStorage } from './CookieStorage.mjs';\nimport { MemoryStorage } from './MemoryStorage.mjs';\nimport { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';\nimport { StaticCacheKeys } from '../utils/BrowserConstants.mjs';\nimport { storageNotSupported } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\nimport { uninitializedPublicClientApplication } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst ENCRYPTION_KEY = \"msal.cache.encryption\";\r\nconst BROADCAST_CHANNEL_NAME = \"msal.broadcast.cache\";\r\nclass LocalStorage {\r\n constructor(clientId, logger, performanceClient) {\r\n if (!window.localStorage) {\r\n throw createBrowserConfigurationAuthError(storageNotSupported);\r\n }\r\n this.memoryStorage = new MemoryStorage();\r\n this.initialized = false;\r\n this.clientId = clientId;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.broadcast = new BroadcastChannel(BROADCAST_CHANNEL_NAME);\r\n }\r\n async initialize(correlationId) {\r\n this.initialized = true;\r\n const cookies = new CookieStorage();\r\n const cookieString = cookies.getItem(ENCRYPTION_KEY);\r\n let parsedCookie = { key: \"\", id: \"\" };\r\n if (cookieString) {\r\n try {\r\n parsedCookie = JSON.parse(cookieString);\r\n }\r\n catch (e) { }\r\n }\r\n if (parsedCookie.key && parsedCookie.id) {\r\n // Encryption key already exists, import\r\n const baseKey = invoke(base64DecToArr, PerformanceEvents.Base64Decode, this.logger, this.performanceClient, correlationId)(parsedCookie.key);\r\n this.encryptionCookie = {\r\n id: parsedCookie.id,\r\n key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),\r\n };\r\n await invokeAsync(this.importExistingCache.bind(this), PerformanceEvents.ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);\r\n }\r\n else {\r\n // Encryption key doesn't exist or is invalid, generate a new one and clear existing cache\r\n this.clear();\r\n const id = createNewGuid();\r\n const baseKey = await invokeAsync(generateBaseKey, PerformanceEvents.GenerateBaseKey, this.logger, this.performanceClient, correlationId)();\r\n const keyStr = invoke(urlEncodeArr, PerformanceEvents.UrlEncodeArr, this.logger, this.performanceClient, correlationId)(new Uint8Array(baseKey));\r\n this.encryptionCookie = {\r\n id: id,\r\n key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),\r\n };\r\n const cookieData = {\r\n id: id,\r\n key: keyStr,\r\n };\r\n cookies.setItem(ENCRYPTION_KEY, JSON.stringify(cookieData), 0, // Expiration - 0 means cookie will be cleared at the end of the browser session\r\n true, // Secure flag\r\n SameSiteOptions.None // SameSite must be None to support iframed apps\r\n );\r\n }\r\n // Register listener for cache updates in other tabs\r\n this.broadcast.addEventListener(\"message\", this.updateCache.bind(this));\r\n }\r\n getItem(key) {\r\n return window.localStorage.getItem(key);\r\n }\r\n getUserData(key) {\r\n if (!this.initialized) {\r\n throw createBrowserAuthError(uninitializedPublicClientApplication);\r\n }\r\n return this.memoryStorage.getItem(key);\r\n }\r\n setItem(key, value) {\r\n window.localStorage.setItem(key, value);\r\n }\r\n async setUserData(key, value, correlationId) {\r\n if (!this.initialized || !this.encryptionCookie) {\r\n throw createBrowserAuthError(uninitializedPublicClientApplication);\r\n }\r\n const { data, nonce } = await invokeAsync(encrypt, PerformanceEvents.Encrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, value, this.getContext(key));\r\n const encryptedData = {\r\n id: this.encryptionCookie.id,\r\n nonce: nonce,\r\n data: data,\r\n };\r\n this.memoryStorage.setItem(key, value);\r\n this.setItem(key, JSON.stringify(encryptedData));\r\n // Notify other frames to update their in-memory cache\r\n this.broadcast.postMessage({\r\n key: key,\r\n value: value,\r\n context: this.getContext(key),\r\n });\r\n }\r\n removeItem(key) {\r\n if (this.memoryStorage.containsKey(key)) {\r\n this.memoryStorage.removeItem(key);\r\n this.broadcast.postMessage({\r\n key: key,\r\n value: null,\r\n context: this.getContext(key),\r\n });\r\n }\r\n window.localStorage.removeItem(key);\r\n }\r\n getKeys() {\r\n return Object.keys(window.localStorage);\r\n }\r\n containsKey(key) {\r\n return window.localStorage.hasOwnProperty(key);\r\n }\r\n /**\r\n * Removes all known MSAL keys from the cache\r\n */\r\n clear() {\r\n // Removes all remaining MSAL cache items\r\n this.memoryStorage.clear();\r\n const accountKeys = getAccountKeys(this);\r\n accountKeys.forEach((key) => this.removeItem(key));\r\n const tokenKeys = getTokenKeys(this.clientId, this);\r\n tokenKeys.idToken.forEach((key) => this.removeItem(key));\r\n tokenKeys.accessToken.forEach((key) => this.removeItem(key));\r\n tokenKeys.refreshToken.forEach((key) => this.removeItem(key));\r\n // Clean up anything left\r\n this.getKeys().forEach((cacheKey) => {\r\n if (cacheKey.startsWith(Constants.CACHE_PREFIX) ||\r\n cacheKey.indexOf(this.clientId) !== -1) {\r\n this.removeItem(cacheKey);\r\n }\r\n });\r\n }\r\n /**\r\n * Helper to decrypt all known MSAL keys in localStorage and save them to inMemory storage\r\n * @returns\r\n */\r\n async importExistingCache(correlationId) {\r\n if (!this.encryptionCookie) {\r\n return;\r\n }\r\n let accountKeys = getAccountKeys(this);\r\n accountKeys = await this.importArray(accountKeys, correlationId);\r\n // Write valid account keys back to map\r\n this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\r\n const tokenKeys = getTokenKeys(this.clientId, this);\r\n tokenKeys.idToken = await this.importArray(tokenKeys.idToken, correlationId);\r\n tokenKeys.accessToken = await this.importArray(tokenKeys.accessToken, correlationId);\r\n tokenKeys.refreshToken = await this.importArray(tokenKeys.refreshToken, correlationId);\r\n // Write valid token keys back to map\r\n this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));\r\n }\r\n /**\r\n * Helper to decrypt and save cache entries\r\n * @param key\r\n * @returns\r\n */\r\n async getItemFromEncryptedCache(key, correlationId) {\r\n if (!this.encryptionCookie) {\r\n return null;\r\n }\r\n const rawCache = this.getItem(key);\r\n if (!rawCache) {\r\n return null;\r\n }\r\n let encObj;\r\n try {\r\n encObj = JSON.parse(rawCache);\r\n }\r\n catch (e) {\r\n // Not a valid encrypted object, remove\r\n return null;\r\n }\r\n if (!encObj.id || !encObj.nonce || !encObj.data) {\r\n // Data is not encrypted, likely from old version of MSAL. It must be removed because we don't know how old it is.\r\n this.performanceClient.incrementFields({ unencryptedCacheCount: 1 }, correlationId);\r\n return null;\r\n }\r\n if (encObj.id !== this.encryptionCookie.id) {\r\n // Data was encrypted with a different key. It must be removed because it is from a previous session.\r\n this.performanceClient.incrementFields({ encryptedCacheExpiredCount: 1 }, correlationId);\r\n return null;\r\n }\r\n return invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, encObj.nonce, this.getContext(key), encObj.data);\r\n }\r\n /**\r\n * Helper to decrypt and save an array of cache keys\r\n * @param arr\r\n * @returns Array of keys successfully imported\r\n */\r\n async importArray(arr, correlationId) {\r\n const importedArr = [];\r\n const promiseArr = [];\r\n arr.forEach((key) => {\r\n const promise = this.getItemFromEncryptedCache(key, correlationId).then((value) => {\r\n if (value) {\r\n this.memoryStorage.setItem(key, value);\r\n importedArr.push(key);\r\n }\r\n else {\r\n // If value is empty, unencrypted or expired remove\r\n this.removeItem(key);\r\n }\r\n });\r\n promiseArr.push(promise);\r\n });\r\n await Promise.all(promiseArr);\r\n return importedArr;\r\n }\r\n /**\r\n * Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries\r\n * @param key\r\n * @returns\r\n */\r\n getContext(key) {\r\n let context = \"\";\r\n if (key.includes(this.clientId)) {\r\n context = this.clientId; // Used to bind encryption key to this appId\r\n }\r\n return context;\r\n }\r\n updateCache(event) {\r\n this.logger.trace(\"Updating internal cache from broadcast event\");\r\n const perfMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.LocalStorageUpdated);\r\n perfMeasurement.add({ isBackground: true });\r\n const { key, value, context } = event.data;\r\n if (!key) {\r\n this.logger.error(\"Broadcast event missing key\");\r\n perfMeasurement.end({ success: false, errorCode: \"noKey\" });\r\n return;\r\n }\r\n if (context && context !== this.clientId) {\r\n this.logger.trace(`Ignoring broadcast event from clientId: ${context}`);\r\n perfMeasurement.end({\r\n success: false,\r\n errorCode: \"contextMismatch\",\r\n });\r\n return;\r\n }\r\n if (!value) {\r\n this.memoryStorage.removeItem(key);\r\n this.logger.verbose(\"Removed item from internal cache\");\r\n }\r\n else {\r\n this.memoryStorage.setItem(key, value);\r\n this.logger.verbose(\"Updated item in internal cache\");\r\n }\r\n perfMeasurement.end({ success: true });\r\n }\r\n}\n\nexport { LocalStorage };\n//# sourceMappingURL=LocalStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { storageNotSupported } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass SessionStorage {\r\n constructor() {\r\n if (!window.sessionStorage) {\r\n throw createBrowserConfigurationAuthError(storageNotSupported);\r\n }\r\n }\r\n async initialize() {\r\n // Session storage does not require initialization\r\n }\r\n getItem(key) {\r\n return window.sessionStorage.getItem(key);\r\n }\r\n getUserData(key) {\r\n return this.getItem(key);\r\n }\r\n setItem(key, value) {\r\n window.sessionStorage.setItem(key, value);\r\n }\r\n async setUserData(key, value) {\r\n this.setItem(key, value);\r\n }\r\n removeItem(key) {\r\n window.sessionStorage.removeItem(key);\r\n }\r\n getKeys() {\r\n return Object.keys(window.sessionStorage);\r\n }\r\n containsKey(key) {\r\n return window.sessionStorage.hasOwnProperty(key);\r\n }\r\n}\n\nexport { SessionStorage };\n//# sourceMappingURL=SessionStorage.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { ProtocolUtils, createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common/browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Extracts the BrowserStateObject from the state string.\r\n * @param browserCrypto\r\n * @param state\r\n */\r\nfunction extractBrowserRequestState(browserCrypto, state) {\r\n if (!state) {\r\n return null;\r\n }\r\n try {\r\n const requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);\r\n return requestStateObj.libraryState.meta;\r\n }\r\n catch (e) {\r\n throw createClientAuthError(ClientAuthErrorCodes.invalidState);\r\n }\r\n}\n\nexport { extractBrowserRequestState };\n//# sourceMappingURL=BrowserProtocolUtils.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst EventType = {\r\n INITIALIZE_START: \"msal:initializeStart\",\r\n INITIALIZE_END: \"msal:initializeEnd\",\r\n ACCOUNT_ADDED: \"msal:accountAdded\",\r\n ACCOUNT_REMOVED: \"msal:accountRemoved\",\r\n ACTIVE_ACCOUNT_CHANGED: \"msal:activeAccountChanged\",\r\n LOGIN_START: \"msal:loginStart\",\r\n LOGIN_SUCCESS: \"msal:loginSuccess\",\r\n LOGIN_FAILURE: \"msal:loginFailure\",\r\n ACQUIRE_TOKEN_START: \"msal:acquireTokenStart\",\r\n ACQUIRE_TOKEN_SUCCESS: \"msal:acquireTokenSuccess\",\r\n ACQUIRE_TOKEN_FAILURE: \"msal:acquireTokenFailure\",\r\n ACQUIRE_TOKEN_NETWORK_START: \"msal:acquireTokenFromNetworkStart\",\r\n SSO_SILENT_START: \"msal:ssoSilentStart\",\r\n SSO_SILENT_SUCCESS: \"msal:ssoSilentSuccess\",\r\n SSO_SILENT_FAILURE: \"msal:ssoSilentFailure\",\r\n ACQUIRE_TOKEN_BY_CODE_START: \"msal:acquireTokenByCodeStart\",\r\n ACQUIRE_TOKEN_BY_CODE_SUCCESS: \"msal:acquireTokenByCodeSuccess\",\r\n ACQUIRE_TOKEN_BY_CODE_FAILURE: \"msal:acquireTokenByCodeFailure\",\r\n HANDLE_REDIRECT_START: \"msal:handleRedirectStart\",\r\n HANDLE_REDIRECT_END: \"msal:handleRedirectEnd\",\r\n POPUP_OPENED: \"msal:popupOpened\",\r\n LOGOUT_START: \"msal:logoutStart\",\r\n LOGOUT_SUCCESS: \"msal:logoutSuccess\",\r\n LOGOUT_FAILURE: \"msal:logoutFailure\",\r\n LOGOUT_END: \"msal:logoutEnd\",\r\n RESTORE_FROM_BFCACHE: \"msal:restoreFromBFCache\",\r\n};\n\nexport { EventType };\n//# sourceMappingURL=EventType.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { CacheManager, AccountEntity, invokeAsync, PerformanceEvents, CredentialType, createClientAuthError, ClientAuthErrorCodes, CacheHelpers, Constants, PersistentCacheKeys, StringUtils, ProtocolUtils, TimeUtils, CacheError, DEFAULT_CRYPTO_IMPLEMENTATION, CcsCredentialType } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { BrowserCacheLocation, StaticCacheKeys, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';\nimport { LocalStorage } from './LocalStorage.mjs';\nimport { SessionStorage } from './SessionStorage.mjs';\nimport { MemoryStorage } from './MemoryStorage.mjs';\nimport { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { base64Encode } from '../encode/Base64Encode.mjs';\nimport { CookieStorage } from './CookieStorage.mjs';\nimport { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { noTokenRequestCacheError, unableToParseTokenRequestCacheError, noCachedAuthorityError, interactionInProgress } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class implements the cache storage interface for MSAL through browser local or session storage.\r\n * Cookies are only used if storeAuthStateInCookie is true, and are only used for\r\n * parameters such as state and nonce, generally.\r\n */\r\nclass BrowserCacheManager extends CacheManager {\r\n constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions) {\r\n super(clientId, cryptoImpl, logger, staticAuthorityOptions);\r\n this.cacheConfig = cacheConfig;\r\n this.logger = logger;\r\n this.internalStorage = new MemoryStorage();\r\n this.browserStorage = getStorageImplementation(clientId, cacheConfig.cacheLocation, logger, performanceClient);\r\n this.temporaryCacheStorage = getStorageImplementation(clientId, cacheConfig.temporaryCacheLocation, logger, performanceClient);\r\n this.cookieStorage = new CookieStorage();\r\n this.performanceClient = performanceClient;\r\n this.eventHandler = eventHandler;\r\n }\r\n async initialize(correlationId) {\r\n await this.browserStorage.initialize(correlationId);\r\n }\r\n /**\r\n * Parses passed value as JSON object, JSON.parse() will throw an error.\r\n * @param input\r\n */\r\n validateAndParseJson(jsonValue) {\r\n try {\r\n const parsedJson = JSON.parse(jsonValue);\r\n /**\r\n * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object\r\n * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check\r\n * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.\r\n *\r\n */\r\n return parsedJson && typeof parsedJson === \"object\"\r\n ? parsedJson\r\n : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n }\r\n /**\r\n * Reads account from cache, deserializes it into an account entity and returns it.\r\n * If account is not found from the key, returns null and removes key from map.\r\n * @param accountKey\r\n * @returns\r\n */\r\n getAccount(accountKey) {\r\n this.logger.trace(\"BrowserCacheManager.getAccount called\");\r\n const serializedAccount = this.browserStorage.getUserData(accountKey);\r\n if (!serializedAccount) {\r\n this.removeAccountKeyFromMap(accountKey);\r\n return null;\r\n }\r\n const parsedAccount = this.validateAndParseJson(serializedAccount);\r\n if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {\r\n this.removeAccountKeyFromMap(accountKey);\r\n return null;\r\n }\r\n return CacheManager.toObject(new AccountEntity(), parsedAccount);\r\n }\r\n /**\r\n * set account entity in the platform cache\r\n * @param account\r\n */\r\n async setAccount(account, correlationId) {\r\n this.logger.trace(\"BrowserCacheManager.setAccount called\");\r\n const key = account.generateAccountKey();\r\n await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, JSON.stringify(account), correlationId);\r\n const wasAdded = this.addAccountKeyToMap(key);\r\n /**\r\n * @deprecated - Remove this in next major version in favor of more consistent LOGIN event\r\n */\r\n if (this.cacheConfig.cacheLocation ===\r\n BrowserCacheLocation.LocalStorage &&\r\n wasAdded) {\r\n this.eventHandler.emitEvent(EventType.ACCOUNT_ADDED, undefined, account.getAccountInfo());\r\n }\r\n }\r\n /**\r\n * Returns the array of account keys currently cached\r\n * @returns\r\n */\r\n getAccountKeys() {\r\n return getAccountKeys(this.browserStorage);\r\n }\r\n /**\r\n * Add a new account to the key map\r\n * @param key\r\n */\r\n addAccountKeyToMap(key) {\r\n this.logger.trace(\"BrowserCacheManager.addAccountKeyToMap called\");\r\n this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${key}`);\r\n const accountKeys = this.getAccountKeys();\r\n if (accountKeys.indexOf(key) === -1) {\r\n // Only add key if it does not already exist in the map\r\n accountKeys.push(key);\r\n this.browserStorage.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\r\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key added\");\r\n return true;\r\n }\r\n else {\r\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key already exists in map\");\r\n return false;\r\n }\r\n }\r\n /**\r\n * Remove an account from the key map\r\n * @param key\r\n */\r\n removeAccountKeyFromMap(key) {\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap called\");\r\n this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${key}`);\r\n const accountKeys = this.getAccountKeys();\r\n const removalIndex = accountKeys.indexOf(key);\r\n if (removalIndex > -1) {\r\n accountKeys.splice(removalIndex, 1);\r\n this.browserStorage.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap account key removed\");\r\n }\r\n else {\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap key not found in existing map\");\r\n }\r\n }\r\n /**\r\n * Extends inherited removeAccount function to include removal of the account key from the map\r\n * @param key\r\n */\r\n async removeAccount(key) {\r\n void super.removeAccount(key);\r\n this.removeAccountKeyFromMap(key);\r\n }\r\n /**\r\n * Removes credentials associated with the provided account\r\n * @param account\r\n */\r\n async removeAccountContext(account) {\r\n await super.removeAccountContext(account);\r\n /**\r\n * @deprecated - Remove this in next major version in favor of more consistent LOGOUT event\r\n */\r\n if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {\r\n this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, account.getAccountInfo());\r\n }\r\n }\r\n /**\r\n * Removes given idToken from the cache and from the key map\r\n * @param key\r\n */\r\n removeIdToken(key) {\r\n super.removeIdToken(key);\r\n this.removeTokenKey(key, CredentialType.ID_TOKEN);\r\n }\r\n /**\r\n * Removes given accessToken from the cache and from the key map\r\n * @param key\r\n */\r\n async removeAccessToken(key) {\r\n void super.removeAccessToken(key);\r\n this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);\r\n }\r\n /**\r\n * Removes given refreshToken from the cache and from the key map\r\n * @param key\r\n */\r\n removeRefreshToken(key) {\r\n super.removeRefreshToken(key);\r\n this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);\r\n }\r\n /**\r\n * Gets the keys for the cached tokens associated with this clientId\r\n * @returns\r\n */\r\n getTokenKeys() {\r\n return getTokenKeys(this.clientId, this.browserStorage);\r\n }\r\n /**\r\n * Adds the given key to the token key map\r\n * @param key\r\n * @param type\r\n */\r\n addTokenKey(key, type) {\r\n this.logger.trace(\"BrowserCacheManager addTokenKey called\");\r\n const tokenKeys = this.getTokenKeys();\r\n switch (type) {\r\n case CredentialType.ID_TOKEN:\r\n if (tokenKeys.idToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - idToken added to map\");\r\n tokenKeys.idToken.push(key);\r\n }\r\n break;\r\n case CredentialType.ACCESS_TOKEN:\r\n if (tokenKeys.accessToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - accessToken added to map\");\r\n tokenKeys.accessToken.push(key);\r\n }\r\n break;\r\n case CredentialType.REFRESH_TOKEN:\r\n if (tokenKeys.refreshToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - refreshToken added to map\");\r\n tokenKeys.refreshToken.push(key);\r\n }\r\n break;\r\n default:\r\n this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${type}`);\r\n throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);\r\n }\r\n this.browserStorage.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));\r\n }\r\n /**\r\n * Removes the given key from the token key map\r\n * @param key\r\n * @param type\r\n */\r\n removeTokenKey(key, type) {\r\n this.logger.trace(\"BrowserCacheManager removeTokenKey called\");\r\n const tokenKeys = this.getTokenKeys();\r\n switch (type) {\r\n case CredentialType.ID_TOKEN:\r\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${key} from map`);\r\n const idRemoval = tokenKeys.idToken.indexOf(key);\r\n if (idRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken removed from map\");\r\n tokenKeys.idToken.splice(idRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n case CredentialType.ACCESS_TOKEN:\r\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${key} from map`);\r\n const accessRemoval = tokenKeys.accessToken.indexOf(key);\r\n if (accessRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken removed from map\");\r\n tokenKeys.accessToken.splice(accessRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n case CredentialType.REFRESH_TOKEN:\r\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${key} from map`);\r\n const refreshRemoval = tokenKeys.refreshToken.indexOf(key);\r\n if (refreshRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken removed from map\");\r\n tokenKeys.refreshToken.splice(refreshRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n default:\r\n this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${type}`);\r\n throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);\r\n }\r\n this.browserStorage.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));\r\n }\r\n /**\r\n * generates idToken entity from a string\r\n * @param idTokenKey\r\n */\r\n getIdTokenCredential(idTokenKey) {\r\n const value = this.browserStorage.getUserData(idTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n return null;\r\n }\r\n const parsedIdToken = this.validateAndParseJson(value);\r\n if (!parsedIdToken || !CacheHelpers.isIdTokenEntity(parsedIdToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: cache hit\");\r\n return parsedIdToken;\r\n }\r\n /**\r\n * set IdToken credential to the platform cache\r\n * @param idToken\r\n */\r\n async setIdTokenCredential(idToken, correlationId) {\r\n this.logger.trace(\"BrowserCacheManager.setIdTokenCredential called\");\r\n const idTokenKey = CacheHelpers.generateCredentialKey(idToken);\r\n await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(idTokenKey, JSON.stringify(idToken), correlationId);\r\n this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n }\r\n /**\r\n * generates accessToken entity from a string\r\n * @param key\r\n */\r\n getAccessTokenCredential(accessTokenKey) {\r\n const value = this.browserStorage.getUserData(accessTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n return null;\r\n }\r\n const parsedAccessToken = this.validateAndParseJson(value);\r\n if (!parsedAccessToken ||\r\n !CacheHelpers.isAccessTokenEntity(parsedAccessToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: cache hit\");\r\n return parsedAccessToken;\r\n }\r\n /**\r\n * set accessToken credential to the platform cache\r\n * @param accessToken\r\n */\r\n async setAccessTokenCredential(accessToken, correlationId) {\r\n this.logger.trace(\"BrowserCacheManager.setAccessTokenCredential called\");\r\n const accessTokenKey = CacheHelpers.generateCredentialKey(accessToken);\r\n await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(accessTokenKey, JSON.stringify(accessToken), correlationId);\r\n this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n }\r\n /**\r\n * generates refreshToken entity from a string\r\n * @param refreshTokenKey\r\n */\r\n getRefreshTokenCredential(refreshTokenKey) {\r\n const value = this.browserStorage.getUserData(refreshTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n return null;\r\n }\r\n const parsedRefreshToken = this.validateAndParseJson(value);\r\n if (!parsedRefreshToken ||\r\n !CacheHelpers.isRefreshTokenEntity(parsedRefreshToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: cache hit\");\r\n return parsedRefreshToken;\r\n }\r\n /**\r\n * set refreshToken credential to the platform cache\r\n * @param refreshToken\r\n */\r\n async setRefreshTokenCredential(refreshToken, correlationId) {\r\n this.logger.trace(\"BrowserCacheManager.setRefreshTokenCredential called\");\r\n const refreshTokenKey = CacheHelpers.generateCredentialKey(refreshToken);\r\n await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(refreshTokenKey, JSON.stringify(refreshToken), correlationId);\r\n this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n }\r\n /**\r\n * fetch appMetadata entity from the platform cache\r\n * @param appMetadataKey\r\n */\r\n getAppMetadata(appMetadataKey) {\r\n const value = this.browserStorage.getItem(appMetadataKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n const parsedMetadata = this.validateAndParseJson(value);\r\n if (!parsedMetadata ||\r\n !CacheHelpers.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: cache hit\");\r\n return parsedMetadata;\r\n }\r\n /**\r\n * set appMetadata entity to the platform cache\r\n * @param appMetadata\r\n */\r\n setAppMetadata(appMetadata) {\r\n this.logger.trace(\"BrowserCacheManager.setAppMetadata called\");\r\n const appMetadataKey = CacheHelpers.generateAppMetadataKey(appMetadata);\r\n this.browserStorage.setItem(appMetadataKey, JSON.stringify(appMetadata));\r\n }\r\n /**\r\n * fetch server telemetry entity from the platform cache\r\n * @param serverTelemetryKey\r\n */\r\n getServerTelemetry(serverTelemetryKey) {\r\n const value = this.browserStorage.getItem(serverTelemetryKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\r\n return null;\r\n }\r\n const parsedEntity = this.validateAndParseJson(value);\r\n if (!parsedEntity ||\r\n !CacheHelpers.isServerTelemetryEntity(serverTelemetryKey, parsedEntity)) {\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: cache hit\");\r\n return parsedEntity;\r\n }\r\n /**\r\n * set server telemetry entity to the platform cache\r\n * @param serverTelemetryKey\r\n * @param serverTelemetry\r\n */\r\n setServerTelemetry(serverTelemetryKey, serverTelemetry) {\r\n this.logger.trace(\"BrowserCacheManager.setServerTelemetry called\");\r\n this.browserStorage.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));\r\n }\r\n /**\r\n *\r\n */\r\n getAuthorityMetadata(key) {\r\n const value = this.internalStorage.getItem(key);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n const parsedMetadata = this.validateAndParseJson(value);\r\n if (parsedMetadata &&\r\n CacheHelpers.isAuthorityMetadataEntity(key, parsedMetadata)) {\r\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: cache hit\");\r\n return parsedMetadata;\r\n }\r\n return null;\r\n }\r\n /**\r\n *\r\n */\r\n getAuthorityMetadataKeys() {\r\n const allKeys = this.internalStorage.getKeys();\r\n return allKeys.filter((key) => {\r\n return this.isAuthorityMetadata(key);\r\n });\r\n }\r\n /**\r\n * Sets wrapper metadata in memory\r\n * @param wrapperSKU\r\n * @param wrapperVersion\r\n */\r\n setWrapperMetadata(wrapperSKU, wrapperVersion) {\r\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);\r\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);\r\n }\r\n /**\r\n * Returns wrapper metadata from in-memory storage\r\n */\r\n getWrapperMetadata() {\r\n const sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) ||\r\n Constants.EMPTY_STRING;\r\n const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) ||\r\n Constants.EMPTY_STRING;\r\n return [sku, version];\r\n }\r\n /**\r\n *\r\n * @param entity\r\n */\r\n setAuthorityMetadata(key, entity) {\r\n this.logger.trace(\"BrowserCacheManager.setAuthorityMetadata called\");\r\n this.internalStorage.setItem(key, JSON.stringify(entity));\r\n }\r\n /**\r\n * Gets the active account\r\n */\r\n getActiveAccount() {\r\n const activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\r\n const activeAccountValueFilters = this.browserStorage.getItem(activeAccountKeyFilters);\r\n if (!activeAccountValueFilters) {\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account filters found\");\r\n return null;\r\n }\r\n const activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);\r\n if (activeAccountValueObj) {\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Active account filters schema found\");\r\n return this.getAccountInfoFilteredBy({\r\n homeAccountId: activeAccountValueObj.homeAccountId,\r\n localAccountId: activeAccountValueObj.localAccountId,\r\n tenantId: activeAccountValueObj.tenantId,\r\n });\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account found\");\r\n return null;\r\n }\r\n /**\r\n * Sets the active account's localAccountId in cache\r\n * @param account\r\n */\r\n setActiveAccount(account) {\r\n const activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\r\n if (account) {\r\n this.logger.verbose(\"setActiveAccount: Active account set\");\r\n const activeAccountValue = {\r\n homeAccountId: account.homeAccountId,\r\n localAccountId: account.localAccountId,\r\n tenantId: account.tenantId,\r\n };\r\n this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));\r\n }\r\n else {\r\n this.logger.verbose(\"setActiveAccount: No account passed, active account not set\");\r\n this.browserStorage.removeItem(activeAccountKey);\r\n }\r\n this.eventHandler.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);\r\n }\r\n /**\r\n * fetch throttling entity from the platform cache\r\n * @param throttlingCacheKey\r\n */\r\n getThrottlingCache(throttlingCacheKey) {\r\n const value = this.browserStorage.getItem(throttlingCacheKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\r\n return null;\r\n }\r\n const parsedThrottlingCache = this.validateAndParseJson(value);\r\n if (!parsedThrottlingCache ||\r\n !CacheHelpers.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: cache hit\");\r\n return parsedThrottlingCache;\r\n }\r\n /**\r\n * set throttling entity to the platform cache\r\n * @param throttlingCacheKey\r\n * @param throttlingCache\r\n */\r\n setThrottlingCache(throttlingCacheKey, throttlingCache) {\r\n this.logger.trace(\"BrowserCacheManager.setThrottlingCache called\");\r\n this.browserStorage.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));\r\n }\r\n /**\r\n * Gets cache item with given key.\r\n * Will retrieve from cookies if storeAuthStateInCookie is set to true.\r\n * @param key\r\n */\r\n getTemporaryCache(cacheKey, generateKey) {\r\n const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n const itemCookie = this.cookieStorage.getItem(key);\r\n if (itemCookie) {\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies\");\r\n return itemCookie;\r\n }\r\n }\r\n const value = this.temporaryCacheStorage.getItem(key);\r\n if (!value) {\r\n // If temp cache item not found in session/memory, check local storage for items set by old versions\r\n if (this.cacheConfig.cacheLocation ===\r\n BrowserCacheLocation.LocalStorage) {\r\n const item = this.browserStorage.getItem(key);\r\n if (item) {\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage\");\r\n return item;\r\n }\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: No cache item found in local storage\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item returned\");\r\n return value;\r\n }\r\n /**\r\n * Sets the cache item with the key and value given.\r\n * Stores in cookie if storeAuthStateInCookie is set to true.\r\n * This can cause cookie overflow if used incorrectly.\r\n * @param key\r\n * @param value\r\n */\r\n setTemporaryCache(cacheKey, value, generateKey) {\r\n const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\r\n this.temporaryCacheStorage.setItem(key, value);\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n this.logger.trace(\"BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie\");\r\n this.cookieStorage.setItem(key, value, undefined, this.cacheConfig.secureCookies);\r\n }\r\n }\r\n /**\r\n * Removes the cache item with the given key.\r\n * @param key\r\n */\r\n removeItem(key) {\r\n this.browserStorage.removeItem(key);\r\n }\r\n /**\r\n * Removes the temporary cache item with the given key.\r\n * Will also clear the cookie item if storeAuthStateInCookie is set to true.\r\n * @param key\r\n */\r\n removeTemporaryItem(key) {\r\n this.temporaryCacheStorage.removeItem(key);\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n this.logger.trace(\"BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie\");\r\n this.cookieStorage.removeItem(key);\r\n }\r\n }\r\n /**\r\n * Gets all keys in window.\r\n */\r\n getKeys() {\r\n return this.browserStorage.getKeys();\r\n }\r\n /**\r\n * Clears all cache entries created by MSAL.\r\n */\r\n async clear() {\r\n // Removes all accounts and their credentials\r\n await this.removeAllAccounts();\r\n this.removeAppMetadata();\r\n // Remove temp storage first to make sure any cookies are cleared\r\n this.temporaryCacheStorage.getKeys().forEach((cacheKey) => {\r\n if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||\r\n cacheKey.indexOf(this.clientId) !== -1) {\r\n this.removeTemporaryItem(cacheKey);\r\n }\r\n });\r\n // Removes all remaining MSAL cache items\r\n this.browserStorage.getKeys().forEach((cacheKey) => {\r\n if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||\r\n cacheKey.indexOf(this.clientId) !== -1) {\r\n this.browserStorage.removeItem(cacheKey);\r\n }\r\n });\r\n this.internalStorage.clear();\r\n }\r\n /**\r\n * Clears all access tokes that have claims prior to saving the current one\r\n * @param performanceClient {IPerformanceClient}\r\n * @param correlationId {string} correlation id\r\n * @returns\r\n */\r\n async clearTokensAndKeysWithClaims(performanceClient, correlationId) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.ClearTokensAndKeysWithClaims, correlationId);\r\n const tokenKeys = this.getTokenKeys();\r\n const removedAccessTokens = [];\r\n tokenKeys.accessToken.forEach((key) => {\r\n // if the access token has claims in its key, remove the token key and the token\r\n const credential = this.getAccessTokenCredential(key);\r\n if (credential?.requestedClaimsHash &&\r\n key.includes(credential.requestedClaimsHash.toLowerCase())) {\r\n removedAccessTokens.push(this.removeAccessToken(key));\r\n }\r\n });\r\n await Promise.all(removedAccessTokens);\r\n // warn if any access tokens are removed\r\n if (removedAccessTokens.length > 0) {\r\n this.logger.warning(`${removedAccessTokens.length} access tokens with claims in the cache keys have been removed from the cache.`);\r\n }\r\n }\r\n /**\r\n * Prepend msal. to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)\r\n * @param key\r\n * @param addInstanceId\r\n */\r\n generateCacheKey(key) {\r\n const generatedKey = this.validateAndParseJson(key);\r\n if (!generatedKey) {\r\n if (StringUtils.startsWith(key, Constants.CACHE_PREFIX)) {\r\n return key;\r\n }\r\n return `${Constants.CACHE_PREFIX}.${this.clientId}.${key}`;\r\n }\r\n return JSON.stringify(key);\r\n }\r\n /**\r\n * Create authorityKey to cache authority\r\n * @param state\r\n */\r\n generateAuthorityKey(stateString) {\r\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\r\n return this.generateCacheKey(`${TemporaryCacheKeys.AUTHORITY}.${stateId}`);\r\n }\r\n /**\r\n * Create Nonce key to cache nonce\r\n * @param state\r\n */\r\n generateNonceKey(stateString) {\r\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\r\n return this.generateCacheKey(`${TemporaryCacheKeys.NONCE_IDTOKEN}.${stateId}`);\r\n }\r\n /**\r\n * Creates full cache key for the request state\r\n * @param stateString State string for the request\r\n */\r\n generateStateKey(stateString) {\r\n // Use the library state id to key temp storage for uniqueness for multiple concurrent requests\r\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\r\n return this.generateCacheKey(`${TemporaryCacheKeys.REQUEST_STATE}.${stateId}`);\r\n }\r\n /**\r\n * Gets the cached authority based on the cached state. Returns empty if no cached state found.\r\n */\r\n getCachedAuthority(cachedState) {\r\n const stateCacheKey = this.generateStateKey(cachedState);\r\n const state = this.getTemporaryCache(stateCacheKey);\r\n if (!state) {\r\n return null;\r\n }\r\n const authorityCacheKey = this.generateAuthorityKey(state);\r\n return this.getTemporaryCache(authorityCacheKey);\r\n }\r\n /**\r\n * Updates account, authority, and state in cache\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n */\r\n updateCacheEntries(state, nonce, authorityInstance, loginHint, account) {\r\n this.logger.trace(\"BrowserCacheManager.updateCacheEntries called\");\r\n // Cache the request state\r\n const stateCacheKey = this.generateStateKey(state);\r\n this.setTemporaryCache(stateCacheKey, state, false);\r\n // Cache the nonce\r\n const nonceCacheKey = this.generateNonceKey(state);\r\n this.setTemporaryCache(nonceCacheKey, nonce, false);\r\n // Cache authorityKey\r\n const authorityCacheKey = this.generateAuthorityKey(state);\r\n this.setTemporaryCache(authorityCacheKey, authorityInstance, false);\r\n if (account) {\r\n const ccsCredential = {\r\n credential: account.homeAccountId,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID,\r\n };\r\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\r\n }\r\n else if (loginHint) {\r\n const ccsCredential = {\r\n credential: loginHint,\r\n type: CcsCredentialType.UPN,\r\n };\r\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\r\n }\r\n }\r\n /**\r\n * Reset all temporary cache items\r\n * @param state\r\n */\r\n resetRequestCache(state) {\r\n this.logger.trace(\"BrowserCacheManager.resetRequestCache called\");\r\n // check state and remove associated cache items\r\n if (state) {\r\n this.temporaryCacheStorage.getKeys().forEach((key) => {\r\n if (key.indexOf(state) !== -1) {\r\n this.removeTemporaryItem(key);\r\n }\r\n });\r\n // delete generic interactive request parameters\r\n this.removeTemporaryItem(this.generateStateKey(state));\r\n this.removeTemporaryItem(this.generateNonceKey(state));\r\n this.removeTemporaryItem(this.generateAuthorityKey(state));\r\n }\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\r\n this.setInteractionInProgress(false);\r\n }\r\n /**\r\n * Removes temporary cache for the provided state\r\n * @param stateString\r\n */\r\n cleanRequestByState(stateString) {\r\n this.logger.trace(\"BrowserCacheManager.cleanRequestByState called\");\r\n // Interaction is completed - remove interaction status.\r\n if (stateString) {\r\n const stateKey = this.generateStateKey(stateString);\r\n const cachedState = this.temporaryCacheStorage.getItem(stateKey);\r\n this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${cachedState}`);\r\n this.resetRequestCache(cachedState || Constants.EMPTY_STRING);\r\n }\r\n }\r\n /**\r\n * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state\r\n * Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.\r\n * @param interactionType\r\n */\r\n cleanRequestByInteractionType(interactionType) {\r\n this.logger.trace(\"BrowserCacheManager.cleanRequestByInteractionType called\");\r\n // Loop through all keys to find state key\r\n this.temporaryCacheStorage.getKeys().forEach((key) => {\r\n // If this key is not the state key, move on\r\n if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {\r\n return;\r\n }\r\n // Retrieve state value, return if not a valid value\r\n const stateValue = this.temporaryCacheStorage.getItem(key);\r\n if (!stateValue) {\r\n return;\r\n }\r\n // Extract state and ensure it matches given InteractionType, then clean request cache\r\n const parsedState = extractBrowserRequestState(this.cryptoImpl, stateValue);\r\n if (parsedState &&\r\n parsedState.interactionType === interactionType) {\r\n this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${stateValue}`);\r\n this.resetRequestCache(stateValue);\r\n }\r\n });\r\n this.setInteractionInProgress(false);\r\n }\r\n cacheCodeRequest(authCodeRequest) {\r\n this.logger.trace(\"BrowserCacheManager.cacheCodeRequest called\");\r\n const encodedValue = base64Encode(JSON.stringify(authCodeRequest));\r\n this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);\r\n }\r\n /**\r\n * Gets the token exchange parameters from the cache. Throws an error if nothing is found.\r\n */\r\n getCachedRequest(state) {\r\n this.logger.trace(\"BrowserCacheManager.getCachedRequest called\");\r\n // Get token request from cache and parse as TokenExchangeParameters.\r\n const encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);\r\n if (!encodedTokenRequest) {\r\n throw createBrowserAuthError(noTokenRequestCacheError);\r\n }\r\n let parsedRequest;\r\n try {\r\n parsedRequest = JSON.parse(base64Decode(encodedTokenRequest));\r\n }\r\n catch (e) {\r\n this.logger.errorPii(`Attempted to parse: ${encodedTokenRequest}`);\r\n this.logger.error(`Parsing cached token request threw with error: ${e}`);\r\n throw createBrowserAuthError(unableToParseTokenRequestCacheError);\r\n }\r\n this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\r\n // Get cached authority and use if no authority is cached with request.\r\n if (!parsedRequest.authority) {\r\n const authorityCacheKey = this.generateAuthorityKey(state);\r\n const cachedAuthority = this.getTemporaryCache(authorityCacheKey);\r\n if (!cachedAuthority) {\r\n throw createBrowserAuthError(noCachedAuthorityError);\r\n }\r\n parsedRequest.authority = cachedAuthority;\r\n }\r\n return parsedRequest;\r\n }\r\n /**\r\n * Gets cached native request for redirect flows\r\n */\r\n getCachedNativeRequest() {\r\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest called\");\r\n const cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);\r\n if (!cachedRequest) {\r\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest: No cached native request found\");\r\n return null;\r\n }\r\n const parsedRequest = this.validateAndParseJson(cachedRequest);\r\n if (!parsedRequest) {\r\n this.logger.error(\"BrowserCacheManager.getCachedNativeRequest: Unable to parse native request\");\r\n return null;\r\n }\r\n return parsedRequest;\r\n }\r\n isInteractionInProgress(matchClientId) {\r\n const clientId = this.getInteractionInProgress();\r\n if (matchClientId) {\r\n return clientId === this.clientId;\r\n }\r\n else {\r\n return !!clientId;\r\n }\r\n }\r\n getInteractionInProgress() {\r\n const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;\r\n return this.getTemporaryCache(key, false);\r\n }\r\n setInteractionInProgress(inProgress) {\r\n // Ensure we don't overwrite interaction in progress for a different clientId\r\n const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;\r\n if (inProgress) {\r\n if (this.getInteractionInProgress()) {\r\n throw createBrowserAuthError(interactionInProgress);\r\n }\r\n else {\r\n // No interaction is in progress\r\n this.setTemporaryCache(key, this.clientId, false);\r\n }\r\n }\r\n else if (!inProgress &&\r\n this.getInteractionInProgress() === this.clientId) {\r\n this.removeTemporaryItem(key);\r\n }\r\n }\r\n /**\r\n * Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache\r\n * @param result\r\n * @param request\r\n */\r\n async hydrateCache(result, request) {\r\n const idTokenEntity = CacheHelpers.createIdTokenEntity(result.account?.homeAccountId, result.account?.environment, result.idToken, this.clientId, result.tenantId);\r\n let claimsHash;\r\n if (request.claims) {\r\n claimsHash = await this.cryptoImpl.hashString(request.claims);\r\n }\r\n /**\r\n * meta data for cache stores time in seconds from epoch\r\n * AuthenticationResult returns expiresOn and extExpiresOn in milliseconds (as a Date object which is in ms)\r\n * We need to map these for the cache when building tokens from AuthenticationResult\r\n *\r\n * The next MSAL VFuture should map these both to same value if possible\r\n */\r\n const accessTokenEntity = CacheHelpers.createAccessTokenEntity(result.account?.homeAccountId, result.account.environment, result.accessToken, this.clientId, result.tenantId, result.scopes.join(\" \"), \r\n // Access token expiresOn stored in seconds, converting from AuthenticationResult expiresOn stored as Date\r\n result.expiresOn\r\n ? TimeUtils.toSecondsFromDate(result.expiresOn)\r\n : 0, result.extExpiresOn\r\n ? TimeUtils.toSecondsFromDate(result.extExpiresOn)\r\n : 0, base64Decode, undefined, // refreshOn\r\n result.tokenType, undefined, // userAssertionHash\r\n request.sshKid, request.claims, claimsHash);\r\n const cacheRecord = {\r\n idToken: idTokenEntity,\r\n accessToken: accessTokenEntity,\r\n };\r\n return this.saveCacheRecord(cacheRecord, result.correlationId);\r\n }\r\n /**\r\n * saves a cache record\r\n * @param cacheRecord {CacheRecord}\r\n * @param storeInCache {?StoreInCache}\r\n * @param correlationId {?string} correlation id\r\n */\r\n async saveCacheRecord(cacheRecord, correlationId, storeInCache) {\r\n try {\r\n await super.saveCacheRecord(cacheRecord, correlationId, storeInCache);\r\n }\r\n catch (e) {\r\n if (e instanceof CacheError &&\r\n this.performanceClient &&\r\n correlationId) {\r\n try {\r\n const tokenKeys = this.getTokenKeys();\r\n this.performanceClient.addFields({\r\n cacheRtCount: tokenKeys.refreshToken.length,\r\n cacheIdCount: tokenKeys.idToken.length,\r\n cacheAtCount: tokenKeys.accessToken.length,\r\n }, correlationId);\r\n }\r\n catch (e) { }\r\n }\r\n throw e;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.\r\n * @param cacheLocation\r\n */\r\nfunction getStorageImplementation(clientId, cacheLocation, logger, performanceClient) {\r\n try {\r\n switch (cacheLocation) {\r\n case BrowserCacheLocation.LocalStorage:\r\n return new LocalStorage(clientId, logger, performanceClient);\r\n case BrowserCacheLocation.SessionStorage:\r\n return new SessionStorage();\r\n case BrowserCacheLocation.MemoryStorage:\r\n default:\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n logger.error(e);\r\n }\r\n return new MemoryStorage();\r\n}\r\nconst DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler) => {\r\n const cacheOptions = {\r\n cacheLocation: BrowserCacheLocation.MemoryStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n cacheMigrationEnabled: false,\r\n claimsBasedCachingEnabled: false,\r\n };\r\n return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient, eventHandler);\r\n};\n\nexport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER };\n//# sourceMappingURL=BrowserCacheManager.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\r\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\r\n * @returns Array of AccountInfo objects in cache\r\n */\r\nfunction getAllAccounts(logger, browserStorage, isInBrowser, accountFilter) {\r\n logger.verbose(\"getAllAccounts called\");\r\n return isInBrowser ? browserStorage.getAllAccounts(accountFilter) : [];\r\n}\r\n/**\r\n * Returns the first account found in the cache that matches the account filter passed in.\r\n * @param accountFilter\r\n * @returns The first account found in the cache matching the provided filter or null if no account could be found.\r\n */\r\nfunction getAccount(accountFilter, logger, browserStorage) {\r\n logger.trace(\"getAccount called\");\r\n if (Object.keys(accountFilter).length === 0) {\r\n logger.warning(\"getAccount: No accountFilter provided\");\r\n return null;\r\n }\r\n const account = browserStorage.getAccountInfoFilteredBy(accountFilter);\r\n if (account) {\r\n logger.verbose(\"getAccount: Account matching provided filter found, returning\");\r\n return account;\r\n }\r\n else {\r\n logger.verbose(\"getAccount: No matching account found, returning null\");\r\n return null;\r\n }\r\n}\r\n/**\r\n * Returns the signed in account matching username.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found.\r\n * This API is provided for convenience but getAccountById should be used for best reliability\r\n * @param username\r\n * @returns The account object stored in MSAL\r\n */\r\nfunction getAccountByUsername(username, logger, browserStorage) {\r\n logger.trace(\"getAccountByUsername called\");\r\n if (!username) {\r\n logger.warning(\"getAccountByUsername: No username provided\");\r\n return null;\r\n }\r\n const account = browserStorage.getAccountInfoFilteredBy({\r\n username,\r\n });\r\n if (account) {\r\n logger.verbose(\"getAccountByUsername: Account matching username found, returning\");\r\n logger.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${username}`);\r\n return account;\r\n }\r\n else {\r\n logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\r\n return null;\r\n }\r\n}\r\n/**\r\n * Returns the signed in account matching homeAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param homeAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\nfunction getAccountByHomeId(homeAccountId, logger, browserStorage) {\r\n logger.trace(\"getAccountByHomeId called\");\r\n if (!homeAccountId) {\r\n logger.warning(\"getAccountByHomeId: No homeAccountId provided\");\r\n return null;\r\n }\r\n const account = browserStorage.getAccountInfoFilteredBy({\r\n homeAccountId,\r\n });\r\n if (account) {\r\n logger.verbose(\"getAccountByHomeId: Account matching homeAccountId found, returning\");\r\n logger.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\r\n return account;\r\n }\r\n else {\r\n logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\r\n return null;\r\n }\r\n}\r\n/**\r\n * Returns the signed in account matching localAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param localAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\nfunction getAccountByLocalId(localAccountId, logger, browserStorage) {\r\n logger.trace(\"getAccountByLocalId called\");\r\n if (!localAccountId) {\r\n logger.warning(\"getAccountByLocalId: No localAccountId provided\");\r\n return null;\r\n }\r\n const account = browserStorage.getAccountInfoFilteredBy({\r\n localAccountId,\r\n });\r\n if (account) {\r\n logger.verbose(\"getAccountByLocalId: Account matching localAccountId found, returning\");\r\n logger.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${localAccountId}`);\r\n return account;\r\n }\r\n else {\r\n logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\r\n return null;\r\n }\r\n}\r\n/**\r\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\r\n * @param account\r\n */\r\nfunction setActiveAccount(account, browserStorage) {\r\n browserStorage.setActiveAccount(account);\r\n}\r\n/**\r\n * Gets the currently active account\r\n */\r\nfunction getActiveAccount(browserStorage) {\r\n return browserStorage.getActiveAccount();\r\n}\n\nexport { getAccount, getAccountByHomeId, getAccountByLocalId, getAccountByUsername, getActiveAccount, getAllAccounts, setActiveAccount };\n//# sourceMappingURL=AccountManager.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { Logger } from '@azure/msal-common/browser';\nimport { EventType } from './EventType.mjs';\nimport { createGuid } from '../utils/BrowserUtils.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst BROADCAST_CHANNEL_NAME = \"msal.broadcast.event\";\r\nclass EventHandler {\r\n constructor(logger) {\r\n this.eventCallbacks = new Map();\r\n this.logger = logger || new Logger({});\r\n if (typeof BroadcastChannel !== \"undefined\") {\r\n this.broadcastChannel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);\r\n }\r\n this.invokeCrossTabCallbacks = this.invokeCrossTabCallbacks.bind(this);\r\n }\r\n /**\r\n * Adds event callbacks to array\r\n * @param callback - callback to be invoked when an event is raised\r\n * @param eventTypes - list of events that this callback will be invoked for, if not provided callback will be invoked for all events\r\n * @param callbackId - Identifier for the callback, used to locate and remove the callback when no longer required\r\n */\r\n addEventCallback(callback, eventTypes, callbackId) {\r\n if (typeof window !== \"undefined\") {\r\n const id = callbackId || createGuid();\r\n if (this.eventCallbacks.has(id)) {\r\n this.logger.error(`Event callback with id: ${id} is already registered. Please provide a unique id or remove the existing callback and try again.`);\r\n return null;\r\n }\r\n this.eventCallbacks.set(id, [callback, eventTypes || []]);\r\n this.logger.verbose(`Event callback registered with id: ${id}`);\r\n return id;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Removes callback with provided id from callback array\r\n * @param callbackId\r\n */\r\n removeEventCallback(callbackId) {\r\n this.eventCallbacks.delete(callbackId);\r\n this.logger.verbose(`Event callback ${callbackId} removed.`);\r\n }\r\n /**\r\n * Emits events by calling callback with event message\r\n * @param eventType\r\n * @param interactionType\r\n * @param payload\r\n * @param error\r\n */\r\n emitEvent(eventType, interactionType, payload, error) {\r\n const message = {\r\n eventType: eventType,\r\n interactionType: interactionType || null,\r\n payload: payload || null,\r\n error: error || null,\r\n timestamp: Date.now(),\r\n };\r\n switch (eventType) {\r\n case EventType.ACCOUNT_ADDED:\r\n case EventType.ACCOUNT_REMOVED:\r\n case EventType.ACTIVE_ACCOUNT_CHANGED:\r\n // Send event to other open tabs / MSAL instances on same domain\r\n this.broadcastChannel?.postMessage(message);\r\n break;\r\n default:\r\n // Emit event to callbacks registered in this instance\r\n this.invokeCallbacks(message);\r\n break;\r\n }\r\n }\r\n /**\r\n * Invoke registered callbacks\r\n * @param message\r\n */\r\n invokeCallbacks(message) {\r\n this.eventCallbacks.forEach(([callback, eventTypes], callbackId) => {\r\n if (eventTypes.length === 0 ||\r\n eventTypes.includes(message.eventType)) {\r\n this.logger.verbose(`Emitting event to callback ${callbackId}: ${message.eventType}`);\r\n callback.apply(null, [message]);\r\n }\r\n });\r\n }\r\n /**\r\n * Wrapper around invokeCallbacks to handle broadcast events received from other tabs/instances\r\n * @param event\r\n */\r\n invokeCrossTabCallbacks(event) {\r\n const message = event.data;\r\n this.invokeCallbacks(message);\r\n }\r\n /**\r\n * Listen for events broadcasted from other tabs/instances\r\n */\r\n subscribeCrossTab() {\r\n this.broadcastChannel?.addEventListener(\"message\", this.invokeCrossTabCallbacks);\r\n }\r\n /**\r\n * Unsubscribe from broadcast events\r\n */\r\n unsubscribeCrossTab() {\r\n this.broadcastChannel?.removeEventListener(\"message\", this.invokeCrossTabCallbacks);\r\n }\r\n}\n\nexport { EventHandler };\n//# sourceMappingURL=EventHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AccountEntity, UrlString, ServerTelemetryManager, PerformanceEvents, Authority, invokeAsync, AuthorityFactory, createClientConfigurationError, ClientConfigurationErrorCodes } from '@azure/msal-common/browser';\nimport { version } from '../packageMetadata.mjs';\nimport { BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass BaseInteractionClient {\r\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {\r\n this.config = config;\r\n this.browserStorage = storageImpl;\r\n this.browserCrypto = browserCrypto;\r\n this.networkClient = this.config.system.networkClient;\r\n this.eventHandler = eventHandler;\r\n this.navigationClient = navigationClient;\r\n this.nativeMessageHandler = nativeMessageHandler;\r\n this.correlationId = correlationId || createNewGuid();\r\n this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);\r\n this.performanceClient = performanceClient;\r\n }\r\n async clearCacheOnLogout(account) {\r\n if (account) {\r\n if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {\r\n this.logger.verbose(\"Setting active account to null\");\r\n this.browserStorage.setActiveAccount(null);\r\n }\r\n // Clear given account.\r\n try {\r\n await this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account));\r\n this.logger.verbose(\"Cleared cache items belonging to the account provided in the logout request.\");\r\n }\r\n catch (error) {\r\n this.logger.error(\"Account provided in logout request was not found. Local cache unchanged.\");\r\n }\r\n }\r\n else {\r\n try {\r\n this.logger.verbose(\"No account provided in logout request, clearing all cache items.\", this.correlationId);\r\n // Clear all accounts and tokens\r\n await this.browserStorage.clear();\r\n // Clear any stray keys from IndexedDB\r\n await this.browserCrypto.clearKeystore();\r\n }\r\n catch (e) {\r\n this.logger.error(\"Attempted to clear all MSAL cache items and failed. Local cache unchanged.\");\r\n }\r\n }\r\n }\r\n /**\r\n *\r\n * Use to get the redirect uri configured in MSAL or null.\r\n * @param requestRedirectUri\r\n * @returns Redirect URL\r\n *\r\n */\r\n getRedirectUri(requestRedirectUri) {\r\n this.logger.verbose(\"getRedirectUri called\");\r\n const redirectUri = requestRedirectUri || this.config.auth.redirectUri;\r\n return UrlString.getAbsoluteUrl(redirectUri, getCurrentUri());\r\n }\r\n /**\r\n *\r\n * @param apiId\r\n * @param correlationId\r\n * @param forceRefresh\r\n */\r\n initializeServerTelemetryManager(apiId, forceRefresh) {\r\n this.logger.verbose(\"initializeServerTelemetryManager called\");\r\n const telemetryPayload = {\r\n clientId: this.config.auth.clientId,\r\n correlationId: this.correlationId,\r\n apiId: apiId,\r\n forceRefresh: forceRefresh || false,\r\n wrapperSKU: this.browserStorage.getWrapperMetadata()[0],\r\n wrapperVer: this.browserStorage.getWrapperMetadata()[1],\r\n };\r\n return new ServerTelemetryManager(telemetryPayload, this.browserStorage);\r\n }\r\n /**\r\n * Used to get a discovered version of the default authority.\r\n * @param params {\r\n * requestAuthority?: string;\r\n * requestAzureCloudOptions?: AzureCloudOptions;\r\n * requestExtraQueryParameters?: StringDict;\r\n * account?: AccountInfo;\r\n * }\r\n */\r\n async getDiscoveredAuthority(params) {\r\n const { account } = params;\r\n const instanceAwareEQ = params.requestExtraQueryParameters &&\r\n params.requestExtraQueryParameters.hasOwnProperty(\"instance_aware\")\r\n ? params.requestExtraQueryParameters[\"instance_aware\"]\r\n : undefined;\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\r\n const authorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n OIDCOptions: this.config.auth.OIDCOptions,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata,\r\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\r\n };\r\n // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority\r\n const resolvedAuthority = params.requestAuthority || this.config.auth.authority;\r\n const resolvedInstanceAware = instanceAwareEQ?.length\r\n ? instanceAwareEQ === \"true\"\r\n : this.config.auth.instanceAware;\r\n const userAuthority = account && resolvedInstanceAware\r\n ? this.config.auth.authority.replace(UrlString.getDomainFromUrl(resolvedAuthority), account.environment)\r\n : resolvedAuthority;\r\n // fall back to the authority from config\r\n const builtAuthority = Authority.generateAuthority(userAuthority, params.requestAzureCloudOptions ||\r\n this.config.auth.azureCloudOptions);\r\n const discoveredAuthority = await invokeAsync(AuthorityFactory.createDiscoveredInstance, PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.logger, this.performanceClient, this.correlationId)(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.correlationId, this.performanceClient);\r\n if (account && !discoveredAuthority.isAlias(account.environment)) {\r\n throw createClientConfigurationError(ClientConfigurationErrorCodes.authorityMismatch);\r\n }\r\n return discoveredAuthority;\r\n }\r\n}\n\nexport { BaseInteractionClient };\n//# sourceMappingURL=BaseInteractionClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, invokeAsync, AuthenticationScheme, createClientConfigurationError, ClientConfigurationErrorCodes, StringUtils } from '@azure/msal-common/browser';\nimport { hashString } from '../crypto/BrowserCrypto.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Initializer function for all request APIs\r\n * @param request\r\n */\r\nasync function initializeBaseRequest(request, config, performanceClient, logger) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, request.correlationId);\r\n const authority = request.authority || config.auth.authority;\r\n const scopes = [...((request && request.scopes) || [])];\r\n const validatedRequest = {\r\n ...request,\r\n correlationId: request.correlationId,\r\n authority,\r\n scopes,\r\n };\r\n // Set authenticationScheme to BEARER if not explicitly set in the request\r\n if (!validatedRequest.authenticationScheme) {\r\n validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;\r\n logger.verbose('Authentication Scheme wasn\\'t explicitly set in request, defaulting to \"Bearer\" request');\r\n }\r\n else {\r\n if (validatedRequest.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (!request.sshJwk) {\r\n throw createClientConfigurationError(ClientConfigurationErrorCodes.missingSshJwk);\r\n }\r\n if (!request.sshKid) {\r\n throw createClientConfigurationError(ClientConfigurationErrorCodes.missingSshKid);\r\n }\r\n }\r\n logger.verbose(`Authentication Scheme set to \"${validatedRequest.authenticationScheme}\" as configured in Auth request`);\r\n }\r\n // Set requested claims hash if claims-based caching is enabled and claims were requested\r\n if (config.cache.claimsBasedCachingEnabled &&\r\n request.claims &&\r\n // Checks for empty stringified object \"{}\" which doesn't qualify as requested claims\r\n !StringUtils.isEmptyObj(request.claims)) {\r\n validatedRequest.requestedClaimsHash = await hashString(request.claims);\r\n }\r\n return validatedRequest;\r\n}\r\nasync function initializeSilentRequest(request, account, config, performanceClient, logger) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, request.correlationId);\r\n const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, logger, performanceClient, request.correlationId)(request, config, performanceClient, logger);\r\n return {\r\n ...request,\r\n ...baseRequest,\r\n account: account,\r\n forceRefresh: request.forceRefresh || false,\r\n };\r\n}\n\nexport { initializeBaseRequest, initializeSilentRequest };\n//# sourceMappingURL=RequestHelpers.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { UrlString, PerformanceEvents, invokeAsync, AuthorizationCodeClient, Constants, ProtocolUtils } from '@azure/msal-common/browser';\nimport { BaseInteractionClient } from './BaseInteractionClient.mjs';\nimport { BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { version } from '../packageMetadata.mjs';\nimport { getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { initializeBaseRequest } from '../request/RequestHelpers.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\r\n */\r\nclass StandardInteractionClient extends BaseInteractionClient {\r\n /**\r\n * Initializer for the logout request.\r\n * @param logoutRequest\r\n */\r\n initializeLogoutRequest(logoutRequest) {\r\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\r\n const validLogoutRequest = {\r\n correlationId: this.correlationId || createNewGuid(),\r\n ...logoutRequest,\r\n };\r\n /**\r\n * Set logout_hint to be login_hint from ID Token Claims if present\r\n * and logoutHint attribute wasn't manually set in logout request\r\n */\r\n if (logoutRequest) {\r\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\r\n if (!logoutRequest.logoutHint) {\r\n if (logoutRequest.account) {\r\n const logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\r\n if (logoutHint) {\r\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\r\n validLogoutRequest.logoutHint = logoutHint;\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\r\n }\r\n /*\r\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\r\n * Otherwise, use passed uri, config, or current page.\r\n */\r\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\r\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri =\r\n UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, getCurrentUri());\r\n }\r\n else if (this.config.auth.postLogoutRedirectUri === null) {\r\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\r\n }\r\n else if (this.config.auth.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri =\r\n UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, getCurrentUri());\r\n }\r\n else {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri =\r\n UrlString.getAbsoluteUrl(getCurrentUri(), getCurrentUri());\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\r\n }\r\n return validLogoutRequest;\r\n }\r\n /**\r\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\r\n * logout_hint in end session request.\r\n * @param account\r\n */\r\n getLogoutHintFromIdTokenClaims(account) {\r\n const idTokenClaims = account.idTokenClaims;\r\n if (idTokenClaims) {\r\n if (idTokenClaims.login_hint) {\r\n return idTokenClaims.login_hint;\r\n }\r\n else {\r\n this.logger.verbose(\"The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\r\n }\r\n return null;\r\n }\r\n /**\r\n * Creates an Authorization Code Client with the given authority, or the default authority.\r\n * @param params {\r\n * serverTelemetryManager: ServerTelemetryManager;\r\n * authorityUrl?: string;\r\n * requestAzureCloudOptions?: AzureCloudOptions;\r\n * requestExtraQueryParameters?: StringDict;\r\n * account?: AccountInfo;\r\n * }\r\n */\r\n async createAuthCodeClient(params) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);\r\n // Create auth module.\r\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(params);\r\n return new AuthorizationCodeClient(clientConfig, this.performanceClient);\r\n }\r\n /**\r\n * Creates a Client Configuration object with the given request authority, or the default authority.\r\n * @param params {\r\n * serverTelemetryManager: ServerTelemetryManager;\r\n * requestAuthority?: string;\r\n * requestAzureCloudOptions?: AzureCloudOptions;\r\n * requestExtraQueryParameters?: boolean;\r\n * account?: AccountInfo;\r\n * }\r\n */\r\n async getClientConfiguration(params) {\r\n const { serverTelemetryManager, requestAuthority, requestAzureCloudOptions, requestExtraQueryParameters, account, } = params;\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n const discoveredAuthority = await invokeAsync(this.getDiscoveredAuthority.bind(this), PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, this.correlationId)({\r\n requestAuthority,\r\n requestAzureCloudOptions,\r\n requestExtraQueryParameters,\r\n account,\r\n });\r\n const logger = this.config.system.loggerOptions;\r\n return {\r\n authOptions: {\r\n clientId: this.config.auth.clientId,\r\n authority: discoveredAuthority,\r\n clientCapabilities: this.config.auth.clientCapabilities,\r\n redirectUri: this.config.auth.redirectUri,\r\n },\r\n systemOptions: {\r\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\r\n preventCorsPreflight: true,\r\n },\r\n loggerOptions: {\r\n loggerCallback: logger.loggerCallback,\r\n piiLoggingEnabled: logger.piiLoggingEnabled,\r\n logLevel: logger.logLevel,\r\n correlationId: this.correlationId,\r\n },\r\n cacheOptions: {\r\n claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled,\r\n },\r\n cryptoInterface: this.browserCrypto,\r\n networkInterface: this.networkClient,\r\n storageInterface: this.browserStorage,\r\n serverTelemetryManager: serverTelemetryManager,\r\n libraryInfo: {\r\n sku: BrowserConstants.MSAL_SKU,\r\n version: version,\r\n cpu: Constants.EMPTY_STRING,\r\n os: Constants.EMPTY_STRING,\r\n },\r\n telemetry: this.config.telemetry,\r\n };\r\n }\r\n /**\r\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\r\n * @param request\r\n * @param interactionType\r\n */\r\n async initializeAuthorizationRequest(request, interactionType) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);\r\n const redirectUri = this.getRedirectUri(request.redirectUri);\r\n const browserState = {\r\n interactionType: interactionType,\r\n };\r\n const state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);\r\n const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)({ ...request, correlationId: this.correlationId }, this.config, this.performanceClient, this.logger);\r\n const validatedRequest = {\r\n ...baseRequest,\r\n redirectUri: redirectUri,\r\n state: state,\r\n nonce: request.nonce || createNewGuid(),\r\n responseMode: this.config.auth.OIDCOptions\r\n .serverResponseType,\r\n };\r\n // Skip active account lookup if either login hint or session id is set\r\n if (request.loginHint || request.sid) {\r\n return validatedRequest;\r\n }\r\n const account = request.account || this.browserStorage.getActiveAccount();\r\n if (account) {\r\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\r\n this.logger.verbosePii(`Setting validated request account: ${account.homeAccountId}`, this.correlationId);\r\n validatedRequest.account = account;\r\n }\r\n return validatedRequest;\r\n }\r\n}\n\nexport { StandardInteractionClient };\n//# sourceMappingURL=StandardInteractionClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst contentError = \"ContentError\";\r\nconst userSwitch = \"user_switch\";\n\nexport { contentError, userSwitch };\n//# sourceMappingURL=NativeAuthErrorCodes.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Status Codes that can be thrown by WAM\r\nconst USER_INTERACTION_REQUIRED = \"USER_INTERACTION_REQUIRED\";\r\nconst USER_CANCEL = \"USER_CANCEL\";\r\nconst NO_NETWORK = \"NO_NETWORK\";\r\nconst PERSISTENT_ERROR = \"PERSISTENT_ERROR\";\r\nconst DISABLED = \"DISABLED\";\r\nconst ACCOUNT_UNAVAILABLE = \"ACCOUNT_UNAVAILABLE\";\n\nexport { ACCOUNT_UNAVAILABLE, DISABLED, NO_NETWORK, PERSISTENT_ERROR, USER_CANCEL, USER_INTERACTION_REQUIRED };\n//# sourceMappingURL=NativeStatusCodes.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AuthError, InteractionRequiredAuthError, createInteractionRequiredAuthError, InteractionRequiredAuthErrorCodes } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from './BrowserAuthError.mjs';\nimport { contentError, userSwitch } from './NativeAuthErrorCodes.mjs';\nimport { PERSISTENT_ERROR, DISABLED, NO_NETWORK, USER_CANCEL, USER_INTERACTION_REQUIRED, ACCOUNT_UNAVAILABLE } from '../broker/nativeBroker/NativeStatusCodes.mjs';\nimport { noNetworkConnectivity, userCancelled } from './BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst INVALID_METHOD_ERROR = -2147186943;\r\nconst NativeAuthErrorMessages = {\r\n [userSwitch]: \"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again.\",\r\n};\r\nclass NativeAuthError extends AuthError {\r\n constructor(errorCode, description, ext) {\r\n super(errorCode, description);\r\n Object.setPrototypeOf(this, NativeAuthError.prototype);\r\n this.name = \"NativeAuthError\";\r\n this.ext = ext;\r\n }\r\n}\r\n/**\r\n * These errors should result in a fallback to the 'standard' browser based auth flow.\r\n */\r\nfunction isFatalNativeAuthError(error) {\r\n if (error.ext &&\r\n error.ext.status &&\r\n (error.ext.status === PERSISTENT_ERROR ||\r\n error.ext.status === DISABLED)) {\r\n return true;\r\n }\r\n if (error.ext &&\r\n error.ext.error &&\r\n error.ext.error === INVALID_METHOD_ERROR) {\r\n return true;\r\n }\r\n switch (error.errorCode) {\r\n case contentError:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n/**\r\n * Create the appropriate error object based on the WAM status code.\r\n * @param code\r\n * @param description\r\n * @param ext\r\n * @returns\r\n */\r\nfunction createNativeAuthError(code, description, ext) {\r\n if (ext && ext.status) {\r\n switch (ext.status) {\r\n case ACCOUNT_UNAVAILABLE:\r\n return createInteractionRequiredAuthError(InteractionRequiredAuthErrorCodes.nativeAccountUnavailable);\r\n case USER_INTERACTION_REQUIRED:\r\n return new InteractionRequiredAuthError(code, description);\r\n case USER_CANCEL:\r\n return createBrowserAuthError(userCancelled);\r\n case NO_NETWORK:\r\n return createBrowserAuthError(noNetworkConnectivity);\r\n }\r\n }\r\n return new NativeAuthError(code, NativeAuthErrorMessages[code] || description, ext);\r\n}\n\nexport { NativeAuthError, NativeAuthErrorMessages, createNativeAuthError, isFatalNativeAuthError };\n//# sourceMappingURL=NativeAuthError.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { PerformanceEvents, invokeAsync, SilentFlowClient } from '@azure/msal-common/browser';\nimport { ApiId } from '../utils/BrowserConstants.mjs';\nimport { BrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { cryptoKeyNotFound } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass SilentCacheClient extends StandardInteractionClient {\r\n /**\r\n * Returns unexpired tokens from the cache, if available\r\n * @param silentRequest\r\n */\r\n async acquireToken(silentRequest) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\r\n // Telemetry manager only used to increment cacheHits here\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: silentRequest.authority,\r\n requestAzureCloudOptions: silentRequest.azureCloudOptions,\r\n account: silentRequest.account,\r\n });\r\n const silentAuthClient = new SilentFlowClient(clientConfig, this.performanceClient);\r\n this.logger.verbose(\"Silent auth client created\");\r\n try {\r\n const response = await invokeAsync(silentAuthClient.acquireCachedToken.bind(silentAuthClient), PerformanceEvents.SilentFlowClientAcquireCachedToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);\r\n const authResponse = response[0];\r\n this.performanceClient.addFields({\r\n fromCache: true,\r\n }, silentRequest.correlationId);\r\n return authResponse;\r\n }\r\n catch (error) {\r\n if (error instanceof BrowserAuthError &&\r\n error.errorCode === cryptoKeyNotFound) {\r\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\r\n }\r\n throw error;\r\n }\r\n }\r\n /**\r\n * API to silenty clear the browser cache.\r\n * @param logoutRequest\r\n */\r\n logout(logoutRequest) {\r\n this.logger.verbose(\"logoutRedirect called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n return this.clearCacheOnLogout(validLogoutRequest?.account);\r\n }\r\n}\n\nexport { SilentCacheClient };\n//# sourceMappingURL=SilentCacheClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { ServerTelemetryManager, AADServerParamKeys, PerformanceEvents, TimeUtils, ScopeSet, createClientAuthError, ClientAuthErrorCodes, AuthToken, buildAccountToCache, AccountEntity, Constants, AuthorityType, AuthenticationScheme, PopTokenGenerator, updateAccountTenantProfileData, CacheHelpers, createAuthError, AuthErrorCodes, UrlString, OIDC_DEFAULT_SCOPES, invokeAsync, PromptValue } from '@azure/msal-common/browser';\nimport { BaseInteractionClient } from './BaseInteractionClient.mjs';\nimport { NativeConstants, BrowserConstants, CacheLookupPolicy, NativeExtensionMethod, TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.mjs';\nimport { NativeAuthError, isFatalNativeAuthError, createNativeAuthError } from '../error/NativeAuthError.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { SilentCacheClient } from './SilentCacheClient.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { version } from '../packageMetadata.mjs';\nimport { invalidPopTokenRequest, nativePromptNotSupported } from '../error/BrowserAuthErrorCodes.mjs';\nimport { userSwitch } from '../error/NativeAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass NativeInteractionClient extends BaseInteractionClient {\r\n constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {\r\n super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\r\n this.apiId = apiId;\r\n this.accountId = accountId;\r\n this.nativeMessageHandler = provider;\r\n this.nativeStorageManager = nativeStorageImpl;\r\n this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\r\n const extensionName = this.nativeMessageHandler.getExtensionId() ===\r\n NativeConstants.PREFERRED_EXTENSION_ID\r\n ? \"chrome\"\r\n : this.nativeMessageHandler.getExtensionId()?.length\r\n ? \"unknown\"\r\n : undefined;\r\n this.skus = ServerTelemetryManager.makeExtraSkuString({\r\n libraryName: BrowserConstants.MSAL_SKU,\r\n libraryVersion: version,\r\n extensionName: extensionName,\r\n extensionVersion: this.nativeMessageHandler.getExtensionVersion(),\r\n });\r\n }\r\n /**\r\n * Adds SKUs to request extra query parameters\r\n * @param request {NativeTokenRequest}\r\n * @private\r\n */\r\n addRequestSKUs(request) {\r\n request.extraParameters = {\r\n ...request.extraParameters,\r\n [AADServerParamKeys.X_CLIENT_EXTRA_SKU]: this.skus,\r\n };\r\n }\r\n /**\r\n * Acquire token from native platform via browser extension\r\n * @param request\r\n */\r\n async acquireToken(request, cacheLookupPolicy) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\r\n this.logger.trace(\"NativeInteractionClient - acquireToken called.\");\r\n // start the perf measurement\r\n const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\r\n const reqTimestamp = TimeUtils.nowSeconds();\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n try {\r\n // initialize native request\r\n const nativeRequest = await this.initializeNativeRequest(request);\r\n // check if the tokens can be retrieved from internal cache\r\n try {\r\n const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);\r\n nativeATMeasurement.end({\r\n success: true,\r\n isNativeBroker: false,\r\n fromCache: true,\r\n });\r\n return result;\r\n }\r\n catch (e) {\r\n if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {\r\n this.logger.info(\"MSAL internal Cache does not contain tokens, return error as per cache policy\");\r\n throw e;\r\n }\r\n // continue with a native call for any and all errors\r\n this.logger.info(\"MSAL internal Cache does not contain tokens, proceed to make a native call\");\r\n }\r\n const { ...nativeTokenRequest } = nativeRequest;\r\n // fall back to native calls\r\n const messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: nativeTokenRequest,\r\n };\r\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\r\n const validatedResponse = this.validateNativeResponse(response);\r\n return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)\r\n .then((result) => {\r\n nativeATMeasurement.end({\r\n success: true,\r\n isNativeBroker: true,\r\n requestId: result.requestId,\r\n });\r\n serverTelemetryManager.clearNativeBrokerErrorCode();\r\n return result;\r\n })\r\n .catch((error) => {\r\n nativeATMeasurement.end({\r\n success: false,\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n isNativeBroker: true,\r\n });\r\n throw error;\r\n });\r\n }\r\n catch (e) {\r\n if (e instanceof NativeAuthError) {\r\n serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);\r\n }\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Creates silent flow request\r\n * @param request\r\n * @param cachedAccount\r\n * @returns CommonSilentFlowRequest\r\n */\r\n createSilentCacheRequest(request, cachedAccount) {\r\n return {\r\n authority: request.authority,\r\n correlationId: this.correlationId,\r\n scopes: ScopeSet.fromString(request.scope).asArray(),\r\n account: cachedAccount,\r\n forceRefresh: false,\r\n };\r\n }\r\n /**\r\n * Fetches the tokens from the cache if un-expired\r\n * @param nativeAccountId\r\n * @param request\r\n * @returns authenticationResult\r\n */\r\n async acquireTokensFromCache(nativeAccountId, request) {\r\n if (!nativeAccountId) {\r\n this.logger.warning(\"NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided\");\r\n throw createClientAuthError(ClientAuthErrorCodes.noAccountFound);\r\n }\r\n // fetch the account from browser cache\r\n const account = this.browserStorage.getBaseAccountInfo({\r\n nativeAccountId,\r\n });\r\n if (!account) {\r\n throw createClientAuthError(ClientAuthErrorCodes.noAccountFound);\r\n }\r\n // leverage silent flow for cached tokens retrieval\r\n try {\r\n const silentRequest = this.createSilentCacheRequest(request, account);\r\n const result = await this.silentCacheClient.acquireToken(silentRequest);\r\n const fullAccount = {\r\n ...account,\r\n idTokenClaims: result?.idTokenClaims,\r\n idToken: result?.idToken,\r\n };\r\n return {\r\n ...result,\r\n account: fullAccount,\r\n };\r\n }\r\n catch (e) {\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Acquires a token from native platform then redirects to the redirectUri instead of returning the response\r\n * @param {RedirectRequest} request\r\n * @param {InProgressPerformanceEvent} rootMeasurement\r\n */\r\n async acquireTokenRedirect(request, rootMeasurement) {\r\n this.logger.trace(\"NativeInteractionClient - acquireTokenRedirect called.\");\r\n const { ...remainingParameters } = request;\r\n delete remainingParameters.onRedirectNavigate;\r\n const nativeRequest = await this.initializeNativeRequest(remainingParameters);\r\n const messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: nativeRequest,\r\n };\r\n try {\r\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\r\n this.validateNativeResponse(response);\r\n }\r\n catch (e) {\r\n // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise\r\n if (e instanceof NativeAuthError) {\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);\r\n if (isFatalNativeAuthError(e)) {\r\n throw e;\r\n }\r\n }\r\n }\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);\r\n const navigationOptions = {\r\n apiId: ApiId.acquireTokenRedirect,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false,\r\n };\r\n const redirectUri = this.config.auth.navigateToLoginRequestUrl\r\n ? window.location.href\r\n : this.getRedirectUri(request.redirectUri);\r\n rootMeasurement.end({ success: true });\r\n await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again\r\n }\r\n /**\r\n * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response\r\n * @param performanceClient {IPerformanceClient?}\r\n * @param correlationId {string?} correlation identifier\r\n */\r\n async handleRedirectPromise(performanceClient, correlationId) {\r\n this.logger.trace(\"NativeInteractionClient - handleRedirectPromise called.\");\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return null;\r\n }\r\n // remove prompt from the request to prevent WAM from prompting twice\r\n const cachedRequest = this.browserStorage.getCachedNativeRequest();\r\n if (!cachedRequest) {\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.\");\r\n if (performanceClient && correlationId) {\r\n performanceClient?.addFields({ errorCode: \"no_cached_request\" }, correlationId);\r\n }\r\n return null;\r\n }\r\n const { prompt, ...request } = cachedRequest;\r\n if (prompt) {\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.\");\r\n }\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\r\n const messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: request,\r\n };\r\n const reqTimestamp = TimeUtils.nowSeconds();\r\n try {\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise sending message to native broker.\");\r\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\r\n this.validateNativeResponse(response);\r\n const result = this.handleNativeResponse(response, request, reqTimestamp);\r\n this.browserStorage.setInteractionInProgress(false);\r\n const res = await result;\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n serverTelemetryManager.clearNativeBrokerErrorCode();\r\n return res;\r\n }\r\n catch (e) {\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Logout from native platform via browser extension\r\n * @param request\r\n */\r\n logout() {\r\n this.logger.trace(\"NativeInteractionClient - logout called.\");\r\n return Promise.reject(\"Logout not implemented yet\");\r\n }\r\n /**\r\n * Transform response from native platform into AuthenticationResult object which will be returned to the end user\r\n * @param response\r\n * @param request\r\n * @param reqTimestamp\r\n */\r\n async handleNativeResponse(response, request, reqTimestamp) {\r\n this.logger.trace(\"NativeInteractionClient - handleNativeResponse called.\");\r\n // generate identifiers\r\n const idTokenClaims = AuthToken.extractTokenClaims(response.id_token, base64Decode);\r\n const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);\r\n const cachedhomeAccountId = this.browserStorage.getAccountInfoFilteredBy({\r\n nativeAccountId: request.accountId,\r\n })?.homeAccountId;\r\n // add exception for double brokering, please note this is temporary and will be fortified in future\r\n if (request.extraParameters?.child_client_id &&\r\n response.account.id !== request.accountId) {\r\n this.logger.info(\"handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch\");\r\n }\r\n else if (homeAccountIdentifier !== cachedhomeAccountId &&\r\n response.account.id !== request.accountId) {\r\n // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync\r\n throw createNativeAuthError(userSwitch);\r\n }\r\n // Get the preferred_cache domain for the given authority\r\n const authority = await this.getDiscoveredAuthority({\r\n requestAuthority: request.authority,\r\n });\r\n const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, base64Decode, idTokenClaims, response.client_info, undefined, // environment\r\n idTokenClaims.tid, undefined, // auth code payload\r\n response.account.id, this.logger);\r\n // Ensure expires_in is in number format\r\n response.expires_in = Number(response.expires_in);\r\n // generate authenticationResult\r\n const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);\r\n // cache accounts and tokens in the appropriate storage\r\n await this.cacheAccount(baseAccount);\r\n await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, response.access_token, result.tenantId, reqTimestamp);\r\n return result;\r\n }\r\n /**\r\n * creates an homeAccountIdentifier for the account\r\n * @param response\r\n * @param idTokenObj\r\n * @returns\r\n */\r\n createHomeAccountIdentifier(response, idTokenClaims) {\r\n // Save account in browser storage\r\n const homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenClaims);\r\n return homeAccountIdentifier;\r\n }\r\n /**\r\n * Helper to generate scopes\r\n * @param response\r\n * @param request\r\n * @returns\r\n */\r\n generateScopes(response, request) {\r\n return response.scope\r\n ? ScopeSet.fromString(response.scope)\r\n : ScopeSet.fromString(request.scope);\r\n }\r\n /**\r\n * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser\r\n * @param request\r\n * @param response\r\n */\r\n async generatePopAccessToken(response, request) {\r\n if (request.tokenType === AuthenticationScheme.POP &&\r\n request.signPopToken) {\r\n /**\r\n * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT\r\n * is still received, SHR is calculated locally\r\n */\r\n // Check if native layer returned an SHR token\r\n if (response.shr) {\r\n this.logger.trace(\"handleNativeServerResponse: SHR is enabled in native layer\");\r\n return response.shr;\r\n }\r\n // Generate SHR in msal js if WAM does not compute it when POP is enabled\r\n const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\r\n const shrParameters = {\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n shrNonce: request.shrNonce,\r\n };\r\n /**\r\n * KeyID must be present in the native request from when the PoP key was generated in order for\r\n * PopTokenGenerator to query the full key for signing\r\n */\r\n if (!request.keyId) {\r\n throw createClientAuthError(ClientAuthErrorCodes.keyIdMissing);\r\n }\r\n return popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters);\r\n }\r\n else {\r\n return response.access_token;\r\n }\r\n }\r\n /**\r\n * Generates authentication result\r\n * @param response\r\n * @param request\r\n * @param idTokenObj\r\n * @param accountEntity\r\n * @param authority\r\n * @param reqTimestamp\r\n * @returns\r\n */\r\n async generateAuthenticationResult(response, request, idTokenClaims, accountEntity, authority, reqTimestamp) {\r\n // Add Native Broker fields to Telemetry\r\n const mats = this.addTelemetryFromNativeResponse(response);\r\n // If scopes not returned in server response, use request scopes\r\n const responseScopes = response.scope\r\n ? ScopeSet.fromString(response.scope)\r\n : ScopeSet.fromString(request.scope);\r\n const accountProperties = response.account.properties || {};\r\n const uid = accountProperties[\"UID\"] ||\r\n idTokenClaims.oid ||\r\n idTokenClaims.sub ||\r\n Constants.EMPTY_STRING;\r\n const tid = accountProperties[\"TenantId\"] ||\r\n idTokenClaims.tid ||\r\n Constants.EMPTY_STRING;\r\n const accountInfo = updateAccountTenantProfileData(accountEntity.getAccountInfo(), undefined, // tenantProfile optional\r\n idTokenClaims, response.id_token);\r\n /**\r\n * In pairwise broker flows, this check prevents the broker's native account id\r\n * from being returned over the embedded app's account id.\r\n */\r\n if (accountInfo.nativeAccountId !== response.account.id) {\r\n accountInfo.nativeAccountId = response.account.id;\r\n }\r\n // generate PoP token as needed\r\n const responseAccessToken = await this.generatePopAccessToken(response, request);\r\n const tokenType = request.tokenType === AuthenticationScheme.POP\r\n ? AuthenticationScheme.POP\r\n : AuthenticationScheme.BEARER;\r\n const result = {\r\n authority: authority,\r\n uniqueId: uid,\r\n tenantId: tid,\r\n scopes: responseScopes.asArray(),\r\n account: accountInfo,\r\n idToken: response.id_token,\r\n idTokenClaims: idTokenClaims,\r\n accessToken: responseAccessToken,\r\n fromCache: mats ? this.isResponseFromCache(mats) : false,\r\n // Request timestamp and NativeResponse expires_in are in seconds, converting to Date for AuthenticationResult\r\n expiresOn: TimeUtils.toDateFromSeconds(reqTimestamp + response.expires_in),\r\n tokenType: tokenType,\r\n correlationId: this.correlationId,\r\n state: response.state,\r\n fromNativeBroker: true,\r\n };\r\n return result;\r\n }\r\n /**\r\n * cache the account entity in browser storage\r\n * @param accountEntity\r\n */\r\n async cacheAccount(accountEntity) {\r\n // Store the account info and hence `nativeAccountId` in browser cache\r\n await this.browserStorage.setAccount(accountEntity, this.correlationId);\r\n // Remove any existing cached tokens for this account in browser storage\r\n this.browserStorage.removeAccountContext(accountEntity).catch((e) => {\r\n this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);\r\n });\r\n }\r\n /**\r\n * Stores the access_token and id_token in inmemory storage\r\n * @param response\r\n * @param request\r\n * @param homeAccountIdentifier\r\n * @param idTokenObj\r\n * @param responseAccessToken\r\n * @param tenantId\r\n * @param reqTimestamp\r\n */\r\n cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, responseAccessToken, tenantId, reqTimestamp) {\r\n const cachedIdToken = CacheHelpers.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || \"\", request.clientId, idTokenClaims.tid || \"\");\r\n // cache accessToken in inmemory storage\r\n const expiresIn = request.tokenType === AuthenticationScheme.POP\r\n ? Constants.SHR_NONCE_VALIDITY\r\n : (typeof response.expires_in === \"string\"\r\n ? parseInt(response.expires_in, 10)\r\n : response.expires_in) || 0;\r\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\r\n const responseScopes = this.generateScopes(response, request);\r\n const cachedAccessToken = CacheHelpers.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, undefined, request.tokenType, undefined, request.keyId);\r\n const nativeCacheRecord = {\r\n idToken: cachedIdToken,\r\n accessToken: cachedAccessToken,\r\n };\r\n return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, request.storeInCache);\r\n }\r\n addTelemetryFromNativeResponse(response) {\r\n const mats = this.getMATSFromResponse(response);\r\n if (!mats) {\r\n return null;\r\n }\r\n this.performanceClient.addFields({\r\n extensionId: this.nativeMessageHandler.getExtensionId(),\r\n extensionVersion: this.nativeMessageHandler.getExtensionVersion(),\r\n matsBrokerVersion: mats.broker_version,\r\n matsAccountJoinOnStart: mats.account_join_on_start,\r\n matsAccountJoinOnEnd: mats.account_join_on_end,\r\n matsDeviceJoin: mats.device_join,\r\n matsPromptBehavior: mats.prompt_behavior,\r\n matsApiErrorCode: mats.api_error_code,\r\n matsUiVisible: mats.ui_visible,\r\n matsSilentCode: mats.silent_code,\r\n matsSilentBiSubCode: mats.silent_bi_sub_code,\r\n matsSilentMessage: mats.silent_message,\r\n matsSilentStatus: mats.silent_status,\r\n matsHttpStatus: mats.http_status,\r\n matsHttpEventCount: mats.http_event_count,\r\n }, this.correlationId);\r\n return mats;\r\n }\r\n /**\r\n * Validates native platform response before processing\r\n * @param response\r\n */\r\n validateNativeResponse(response) {\r\n if (response.hasOwnProperty(\"access_token\") &&\r\n response.hasOwnProperty(\"id_token\") &&\r\n response.hasOwnProperty(\"client_info\") &&\r\n response.hasOwnProperty(\"account\") &&\r\n response.hasOwnProperty(\"scope\") &&\r\n response.hasOwnProperty(\"expires_in\")) {\r\n return response;\r\n }\r\n else {\r\n throw createAuthError(AuthErrorCodes.unexpectedError, \"Response missing expected properties.\");\r\n }\r\n }\r\n /**\r\n * Gets MATS telemetry from native response\r\n * @param response\r\n * @returns\r\n */\r\n getMATSFromResponse(response) {\r\n if (response.properties.MATS) {\r\n try {\r\n return JSON.parse(response.properties.MATS);\r\n }\r\n catch (e) {\r\n this.logger.error(\"NativeInteractionClient - Error parsing MATS telemetry, returning null instead\");\r\n }\r\n }\r\n return null;\r\n }\r\n /**\r\n * Returns whether or not response came from native cache\r\n * @param response\r\n * @returns\r\n */\r\n isResponseFromCache(mats) {\r\n if (typeof mats.is_cached === \"undefined\") {\r\n this.logger.verbose(\"NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.\");\r\n return false;\r\n }\r\n return !!mats.is_cached;\r\n }\r\n /**\r\n * Translates developer provided request object into NativeRequest object\r\n * @param request\r\n */\r\n async initializeNativeRequest(request) {\r\n this.logger.trace(\"NativeInteractionClient - initializeNativeRequest called\");\r\n const requestAuthority = request.authority || this.config.auth.authority;\r\n if (request.account) {\r\n // validate authority\r\n await this.getDiscoveredAuthority({\r\n requestAuthority,\r\n requestAzureCloudOptions: request.azureCloudOptions,\r\n account: request.account,\r\n });\r\n }\r\n const canonicalAuthority = new UrlString(requestAuthority);\r\n canonicalAuthority.validateAsUri();\r\n // scopes are expected to be received by the native broker as \"scope\" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.\r\n const { scopes, ...remainingProperties } = request;\r\n const scopeSet = new ScopeSet(scopes || []);\r\n scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);\r\n const getPrompt = () => {\r\n // If request is silent, prompt is always none\r\n switch (this.apiId) {\r\n case ApiId.ssoSilent:\r\n case ApiId.acquireTokenSilent_silentFlow:\r\n this.logger.trace(\"initializeNativeRequest: silent request sets prompt to none\");\r\n return PromptValue.NONE;\r\n }\r\n // Prompt not provided, request may proceed and native broker decides if it needs to prompt\r\n if (!request.prompt) {\r\n this.logger.trace(\"initializeNativeRequest: prompt was not provided\");\r\n return undefined;\r\n }\r\n // If request is interactive, check if prompt provided is allowed to go directly to native broker\r\n switch (request.prompt) {\r\n case PromptValue.NONE:\r\n case PromptValue.CONSENT:\r\n case PromptValue.LOGIN:\r\n this.logger.trace(\"initializeNativeRequest: prompt is compatible with native flow\");\r\n return request.prompt;\r\n default:\r\n this.logger.trace(`initializeNativeRequest: prompt = ${request.prompt} is not compatible with native flow`);\r\n throw createBrowserAuthError(nativePromptNotSupported);\r\n }\r\n };\r\n const validatedRequest = {\r\n ...remainingProperties,\r\n accountId: this.accountId,\r\n clientId: this.config.auth.clientId,\r\n authority: canonicalAuthority.urlString,\r\n scope: scopeSet.printScopes(),\r\n redirectUri: this.getRedirectUri(request.redirectUri),\r\n prompt: getPrompt(),\r\n correlationId: this.correlationId,\r\n tokenType: request.authenticationScheme,\r\n windowTitleSubstring: document.title,\r\n extraParameters: {\r\n ...request.extraQueryParameters,\r\n ...request.tokenQueryParameters,\r\n },\r\n extendedExpiryToken: false,\r\n keyId: request.popKid,\r\n };\r\n // Check for PoP token requests: signPopToken should only be set to true if popKid is not set\r\n if (validatedRequest.signPopToken && !!request.popKid) {\r\n throw createBrowserAuthError(invalidPopTokenRequest);\r\n }\r\n this.handleExtraBrokerParams(validatedRequest);\r\n validatedRequest.extraParameters =\r\n validatedRequest.extraParameters || {};\r\n validatedRequest.extraParameters.telemetry =\r\n NativeConstants.MATS_TELEMETRY;\r\n if (request.authenticationScheme === AuthenticationScheme.POP) {\r\n // add POP request type\r\n const shrParameters = {\r\n resourceRequestUri: request.resourceRequestUri,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n shrClaims: request.shrClaims,\r\n shrNonce: request.shrNonce,\r\n };\r\n const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\r\n // generate reqCnf if not provided in the request\r\n let reqCnfData;\r\n if (!validatedRequest.keyId) {\r\n const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(shrParameters, this.logger);\r\n reqCnfData = generatedReqCnfData.reqCnfString;\r\n validatedRequest.keyId = generatedReqCnfData.kid;\r\n validatedRequest.signPopToken = true;\r\n }\r\n else {\r\n reqCnfData = this.browserCrypto.base64UrlEncode(JSON.stringify({ kid: validatedRequest.keyId }));\r\n validatedRequest.signPopToken = false;\r\n }\r\n // SPAs require whole string to be passed to broker\r\n validatedRequest.reqCnf = reqCnfData;\r\n }\r\n this.addRequestSKUs(validatedRequest);\r\n return validatedRequest;\r\n }\r\n /**\r\n * Handles extra broker request parameters\r\n * @param request {NativeTokenRequest}\r\n * @private\r\n */\r\n handleExtraBrokerParams(request) {\r\n const hasExtraBrokerParams = request.extraParameters &&\r\n request.extraParameters.hasOwnProperty(AADServerParamKeys.BROKER_CLIENT_ID) &&\r\n request.extraParameters.hasOwnProperty(AADServerParamKeys.BROKER_REDIRECT_URI) &&\r\n request.extraParameters.hasOwnProperty(AADServerParamKeys.CLIENT_ID);\r\n if (!request.embeddedClientId && !hasExtraBrokerParams) {\r\n return;\r\n }\r\n let child_client_id = \"\";\r\n const child_redirect_uri = request.redirectUri;\r\n if (request.embeddedClientId) {\r\n request.redirectUri = this.config.auth.redirectUri;\r\n child_client_id = request.embeddedClientId;\r\n }\r\n else if (request.extraParameters) {\r\n request.redirectUri =\r\n request.extraParameters[AADServerParamKeys.BROKER_REDIRECT_URI];\r\n child_client_id =\r\n request.extraParameters[AADServerParamKeys.CLIENT_ID];\r\n }\r\n request.extraParameters = {\r\n child_client_id,\r\n child_redirect_uri,\r\n };\r\n this.performanceClient?.addFields({\r\n embeddedClientId: child_client_id,\r\n embeddedRedirectUri: child_redirect_uri,\r\n }, request.correlationId);\r\n }\r\n}\n\nexport { NativeInteractionClient };\n//# sourceMappingURL=NativeInteractionClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { NativeConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.mjs';\nimport { PerformanceEvents, createAuthError, AuthErrorCodes, AuthenticationScheme } from '@azure/msal-common/browser';\nimport { createNativeAuthError } from '../../error/NativeAuthError.mjs';\nimport { createBrowserAuthError } from '../../error/BrowserAuthError.mjs';\nimport { createNewGuid } from '../../crypto/BrowserCrypto.mjs';\nimport { nativeHandshakeTimeout, nativeExtensionNotInstalled } from '../../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass NativeMessageHandler {\r\n constructor(logger, handshakeTimeoutMs, performanceClient, extensionId) {\r\n this.logger = logger;\r\n this.handshakeTimeoutMs = handshakeTimeoutMs;\r\n this.extensionId = extensionId;\r\n this.resolvers = new Map(); // Used for non-handshake messages\r\n this.handshakeResolvers = new Map(); // Used for handshake messages\r\n this.messageChannel = new MessageChannel();\r\n this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound\r\n this.performanceClient = performanceClient;\r\n this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);\r\n }\r\n /**\r\n * Sends a given message to the extension and resolves with the extension response\r\n * @param body\r\n */\r\n async sendMessage(body) {\r\n this.logger.trace(\"NativeMessageHandler - sendMessage called.\");\r\n const req = {\r\n channel: NativeConstants.CHANNEL_ID,\r\n extensionId: this.extensionId,\r\n responseId: createNewGuid(),\r\n body: body,\r\n };\r\n this.logger.trace(\"NativeMessageHandler - Sending request to browser extension\");\r\n this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(req)}`);\r\n this.messageChannel.port1.postMessage(req);\r\n return new Promise((resolve, reject) => {\r\n this.resolvers.set(req.responseId, { resolve, reject });\r\n });\r\n }\r\n /**\r\n * Returns an instance of the MessageHandler that has successfully established a connection with an extension\r\n * @param {Logger} logger\r\n * @param {number} handshakeTimeoutMs\r\n * @param {IPerformanceClient} performanceClient\r\n * @param {ICrypto} crypto\r\n */\r\n static async createProvider(logger, handshakeTimeoutMs, performanceClient) {\r\n logger.trace(\"NativeMessageHandler - createProvider called.\");\r\n try {\r\n const preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, NativeConstants.PREFERRED_EXTENSION_ID);\r\n await preferredProvider.sendHandshakeRequest();\r\n return preferredProvider;\r\n }\r\n catch (e) {\r\n // If preferred extension fails for whatever reason, fallback to using any installed extension\r\n const backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient);\r\n await backupProvider.sendHandshakeRequest();\r\n return backupProvider;\r\n }\r\n }\r\n /**\r\n * Send handshake request helper.\r\n */\r\n async sendHandshakeRequest() {\r\n this.logger.trace(\"NativeMessageHandler - sendHandshakeRequest called.\");\r\n // Register this event listener before sending handshake\r\n window.addEventListener(\"message\", this.windowListener, false); // false is important, because content script message processing should work first\r\n const req = {\r\n channel: NativeConstants.CHANNEL_ID,\r\n extensionId: this.extensionId,\r\n responseId: createNewGuid(),\r\n body: {\r\n method: NativeExtensionMethod.HandshakeRequest,\r\n },\r\n };\r\n this.handshakeEvent.add({\r\n extensionId: this.extensionId,\r\n extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,\r\n });\r\n this.messageChannel.port1.onmessage = (event) => {\r\n this.onChannelMessage(event);\r\n };\r\n window.postMessage(req, window.origin, [this.messageChannel.port2]);\r\n return new Promise((resolve, reject) => {\r\n this.handshakeResolvers.set(req.responseId, { resolve, reject });\r\n this.timeoutId = window.setTimeout(() => {\r\n /*\r\n * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.\r\n * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port\r\n */\r\n window.removeEventListener(\"message\", this.windowListener, false);\r\n this.messageChannel.port1.close();\r\n this.messageChannel.port2.close();\r\n this.handshakeEvent.end({\r\n extensionHandshakeTimedOut: true,\r\n success: false,\r\n });\r\n reject(createBrowserAuthError(nativeHandshakeTimeout));\r\n this.handshakeResolvers.delete(req.responseId);\r\n }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here\r\n });\r\n }\r\n /**\r\n * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.\r\n * @param event\r\n */\r\n onWindowMessage(event) {\r\n this.logger.trace(\"NativeMessageHandler - onWindowMessage called\");\r\n // We only accept messages from ourselves\r\n if (event.source !== window) {\r\n return;\r\n }\r\n const request = event.data;\r\n if (!request.channel ||\r\n request.channel !== NativeConstants.CHANNEL_ID) {\r\n return;\r\n }\r\n if (request.extensionId && request.extensionId !== this.extensionId) {\r\n return;\r\n }\r\n if (request.body.method === NativeExtensionMethod.HandshakeRequest) {\r\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\r\n /*\r\n * Filter out responses with no matched resolvers sooner to keep channel ports open while waiting for\r\n * the proper response.\r\n */\r\n if (!handshakeResolver) {\r\n this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${request.responseId}`);\r\n return;\r\n }\r\n // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed\r\n this.logger.verbose(request.extensionId\r\n ? `Extension with id: ${request.extensionId} not installed`\r\n : \"No extension installed\");\r\n clearTimeout(this.timeoutId);\r\n this.messageChannel.port1.close();\r\n this.messageChannel.port2.close();\r\n window.removeEventListener(\"message\", this.windowListener, false);\r\n this.handshakeEvent.end({\r\n success: false,\r\n extensionInstalled: false,\r\n });\r\n handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled));\r\n }\r\n }\r\n /**\r\n * Invoked when a message is received from the extension on the MessageChannel port\r\n * @param event\r\n */\r\n onChannelMessage(event) {\r\n this.logger.trace(\"NativeMessageHandler - onChannelMessage called.\");\r\n const request = event.data;\r\n const resolver = this.resolvers.get(request.responseId);\r\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\r\n try {\r\n const method = request.body.method;\r\n if (method === NativeExtensionMethod.Response) {\r\n if (!resolver) {\r\n return;\r\n }\r\n const response = request.body.response;\r\n this.logger.trace(\"NativeMessageHandler - Received response from browser extension\");\r\n this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(response)}`);\r\n if (response.status !== \"Success\") {\r\n resolver.reject(createNativeAuthError(response.code, response.description, response.ext));\r\n }\r\n else if (response.result) {\r\n if (response.result[\"code\"] &&\r\n response.result[\"description\"]) {\r\n resolver.reject(createNativeAuthError(response.result[\"code\"], response.result[\"description\"], response.result[\"ext\"]));\r\n }\r\n else {\r\n resolver.resolve(response.result);\r\n }\r\n }\r\n else {\r\n throw createAuthError(AuthErrorCodes.unexpectedError, \"Event does not contain result.\");\r\n }\r\n this.resolvers.delete(request.responseId);\r\n }\r\n else if (method === NativeExtensionMethod.HandshakeResponse) {\r\n if (!handshakeResolver) {\r\n this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${request.responseId}`);\r\n return;\r\n }\r\n clearTimeout(this.timeoutId); // Clear setTimeout\r\n window.removeEventListener(\"message\", this.windowListener, false); // Remove 'No extension' listener\r\n this.extensionId = request.extensionId;\r\n this.extensionVersion = request.body.version;\r\n this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`);\r\n this.handshakeEvent.end({\r\n extensionInstalled: true,\r\n success: true,\r\n });\r\n handshakeResolver.resolve();\r\n this.handshakeResolvers.delete(request.responseId);\r\n }\r\n // Do nothing if method is not Response or HandshakeResponse\r\n }\r\n catch (err) {\r\n this.logger.error(\"Error parsing response from WAM Extension\");\r\n this.logger.errorPii(`Error parsing response from WAM Extension: ${err}`);\r\n this.logger.errorPii(`Unable to parse ${event}`);\r\n if (resolver) {\r\n resolver.reject(err);\r\n }\r\n else if (handshakeResolver) {\r\n handshakeResolver.reject(err);\r\n }\r\n }\r\n }\r\n /**\r\n * Returns the Id for the browser extension this handler is communicating with\r\n * @returns\r\n */\r\n getExtensionId() {\r\n return this.extensionId;\r\n }\r\n /**\r\n * Returns the version for the browser extension this handler is communicating with\r\n * @returns\r\n */\r\n getExtensionVersion() {\r\n return this.extensionVersion;\r\n }\r\n /**\r\n * Returns boolean indicating whether or not the request should attempt to use native broker\r\n * @param logger\r\n * @param config\r\n * @param nativeExtensionProvider\r\n * @param authenticationScheme\r\n */\r\n static isPlatformBrokerAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {\r\n logger.trace(\"isPlatformBrokerAvailable called\");\r\n if (!config.system.allowPlatformBroker) {\r\n logger.trace(\"isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false\");\r\n // Developer disabled WAM\r\n return false;\r\n }\r\n if (!nativeExtensionProvider) {\r\n logger.trace(\"isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false\");\r\n // Extension is not available\r\n return false;\r\n }\r\n if (authenticationScheme) {\r\n switch (authenticationScheme) {\r\n case AuthenticationScheme.BEARER:\r\n case AuthenticationScheme.POP:\r\n logger.trace(\"isPlatformBrokerAvailable: authenticationScheme is supported, returning true\");\r\n return true;\r\n default:\r\n logger.trace(\"isPlatformBrokerAvailable: authenticationScheme is not supported, returning false\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\n\nexport { NativeMessageHandler };\n//# sourceMappingURL=NativeMessageHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, AuthorizeProtocol, ServerError, invokeAsync, CcsCredentialType } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { userCancelled } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Abstract class which defines operations for a browser interaction handling class.\r\n */\r\nclass InteractionHandler {\r\n constructor(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {\r\n this.authModule = authCodeModule;\r\n this.browserStorage = storageImpl;\r\n this.authCodeRequest = authCodeRequest;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Function to handle response parameters from hash.\r\n * @param locationHash\r\n */\r\n async handleCodeResponse(response, request) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponse, request.correlationId);\r\n let authCodeResponse;\r\n try {\r\n authCodeResponse = AuthorizeProtocol.getAuthorizationCodePayload(response, request.state);\r\n }\r\n catch (e) {\r\n if (e instanceof ServerError &&\r\n e.subError === userCancelled) {\r\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\r\n throw createBrowserAuthError(userCancelled);\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n return invokeAsync(this.handleCodeResponseFromServer.bind(this), PerformanceEvents.HandleCodeResponseFromServer, this.logger, this.performanceClient, request.correlationId)(authCodeResponse, request);\r\n }\r\n /**\r\n * Process auth code response from AAD\r\n * @param authCodeResponse\r\n * @param state\r\n * @param authority\r\n * @param networkModule\r\n * @returns\r\n */\r\n async handleCodeResponseFromServer(authCodeResponse, request, validateNonce = true) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromServer, request.correlationId);\r\n this.logger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\r\n // Assign code to request\r\n this.authCodeRequest.code = authCodeResponse.code;\r\n // Check for new cloud instance\r\n if (authCodeResponse.cloud_instance_host_name) {\r\n await invokeAsync(this.authModule.updateAuthority.bind(this.authModule), PerformanceEvents.UpdateTokenEndpointAuthority, this.logger, this.performanceClient, request.correlationId)(authCodeResponse.cloud_instance_host_name, request.correlationId);\r\n }\r\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\r\n if (validateNonce) {\r\n // TODO: Assigning \"response nonce\" to \"request nonce\" is confusing. Refactor the function doing validation to accept request nonce directly\r\n authCodeResponse.nonce = request.nonce || undefined;\r\n }\r\n authCodeResponse.state = request.state;\r\n // Add CCS parameters if available\r\n if (authCodeResponse.client_info) {\r\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\r\n }\r\n else {\r\n const ccsCred = this.createCcsCredentials(request);\r\n if (ccsCred) {\r\n this.authCodeRequest.ccsCredential = ccsCred;\r\n }\r\n }\r\n // Acquire token with retrieved code.\r\n const tokenResponse = (await invokeAsync(this.authModule.acquireToken.bind(this.authModule), PerformanceEvents.AuthClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(this.authCodeRequest, authCodeResponse));\r\n return tokenResponse;\r\n }\r\n /**\r\n * Build ccs creds if available\r\n */\r\n createCcsCredentials(request) {\r\n if (request.account) {\r\n return {\r\n credential: request.account.homeAccountId,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID,\r\n };\r\n }\r\n else if (request.loginHint) {\r\n return {\r\n credential: request.loginHint,\r\n type: CcsCredentialType.UPN,\r\n };\r\n }\r\n return null;\r\n }\r\n}\n\nexport { InteractionHandler };\n//# sourceMappingURL=InteractionHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { UrlUtils } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';\nimport { hashEmptyError, hashDoesNotContainKnownProperties, noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction deserializeResponse(responseString, responseLocation, logger) {\r\n // Deserialize hash fragment response parameters.\r\n const serverParams = UrlUtils.getDeserializedResponse(responseString);\r\n if (!serverParams) {\r\n if (!UrlUtils.stripLeadingHashOrQuery(responseString)) {\r\n // Hash or Query string is empty\r\n logger.error(`The request has returned to the redirectUri but a ${responseLocation} is not present. It's likely that the ${responseLocation} has been removed or the page has been redirected by code running on the redirectUri page.`);\r\n throw createBrowserAuthError(hashEmptyError);\r\n }\r\n else {\r\n logger.error(`A ${responseLocation} is present in the iframe but it does not contain known properties. It's likely that the ${responseLocation} has been replaced by code running on the redirectUri page.`);\r\n logger.errorPii(`The ${responseLocation} detected is: ${responseString}`);\r\n throw createBrowserAuthError(hashDoesNotContainKnownProperties);\r\n }\r\n }\r\n return serverParams;\r\n}\r\n/**\r\n * Returns the interaction type that the response object belongs to\r\n */\r\nfunction validateInteractionType(response, browserCrypto, interactionType) {\r\n if (!response.state) {\r\n throw createBrowserAuthError(noStateInHash);\r\n }\r\n const platformStateObj = extractBrowserRequestState(browserCrypto, response.state);\r\n if (!platformStateObj) {\r\n throw createBrowserAuthError(unableToParseState);\r\n }\r\n if (platformStateObj.interactionType !== interactionType) {\r\n throw createBrowserAuthError(stateInteractionTypeMismatch);\r\n }\r\n}\n\nexport { deserializeResponse, validateInteractionType };\n//# sourceMappingURL=ResponseHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createClientConfigurationError, ClientConfigurationErrorCodes, invokeAsync, PerformanceEvents, RequestParameterBuilder, Constants, AuthorizeProtocol, ProtocolMode, AuthenticationScheme, PopTokenGenerator } from '@azure/msal-common/browser';\nimport { BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { version } from '../packageMetadata.mjs';\nimport { CryptoOps } from '../crypto/CryptoOps.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR\r\n * @param config\r\n * @param authority\r\n * @param request\r\n * @param logger\r\n * @param performanceClient\r\n * @returns\r\n */\r\nasync function getStandardParameters(config, authority, request, logger, performanceClient) {\r\n const parameters = AuthorizeProtocol.getStandardAuthorizeRequestParameters({ ...config.auth, authority: authority }, request, logger, performanceClient);\r\n RequestParameterBuilder.addLibraryInfo(parameters, {\r\n sku: BrowserConstants.MSAL_SKU,\r\n version: version,\r\n os: \"\",\r\n cpu: \"\",\r\n });\r\n if (config.auth.protocolMode !== ProtocolMode.OIDC) {\r\n RequestParameterBuilder.addApplicationTelemetry(parameters, config.telemetry.application);\r\n }\r\n if (request.platformBroker) {\r\n // signal ests that this is a WAM call\r\n RequestParameterBuilder.addNativeBroker(parameters);\r\n // pass the req_cnf for POP\r\n if (request.authenticationScheme === AuthenticationScheme.POP) {\r\n const cryptoOps = new CryptoOps(logger, performanceClient);\r\n const popTokenGenerator = new PopTokenGenerator(cryptoOps);\r\n // req_cnf is always sent as a string for SPAs\r\n let reqCnfData;\r\n if (!request.popKid) {\r\n const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, logger, performanceClient, request.correlationId)(request, logger);\r\n reqCnfData = generatedReqCnfData.reqCnfString;\r\n }\r\n else {\r\n reqCnfData = cryptoOps.encodeKid(request.popKid);\r\n }\r\n RequestParameterBuilder.addPopToken(parameters, reqCnfData);\r\n }\r\n }\r\n RequestParameterBuilder.instrumentBrokerParams(parameters, request.correlationId, performanceClient);\r\n return parameters;\r\n}\r\n/**\r\n * Gets the full /authorize URL with request parameters when using Auth Code + PKCE\r\n * @param config\r\n * @param authority\r\n * @param request\r\n * @param logger\r\n * @param performanceClient\r\n * @returns\r\n */\r\nasync function getAuthCodeRequestUrl(config, authority, request, logger, performanceClient) {\r\n if (!request.codeChallenge) {\r\n throw createClientConfigurationError(ClientConfigurationErrorCodes.pkceParamsMissing);\r\n }\r\n const parameters = await invokeAsync(getStandardParameters, PerformanceEvents.GetStandardParams, logger, performanceClient, request.correlationId)(config, authority, request, logger, performanceClient);\r\n RequestParameterBuilder.addResponseTypeCode(parameters);\r\n RequestParameterBuilder.addCodeChallengeParams(parameters, request.codeChallenge, Constants.S256_CODE_CHALLENGE_METHOD);\r\n return AuthorizeProtocol.getAuthorizeUrl(authority, parameters);\r\n}\n\nexport { getAuthCodeRequestUrl };\n//# sourceMappingURL=Authorize.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, invoke, invokeAsync } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { urlEncodeArr } from '../encode/Base64Encode.mjs';\nimport { getRandomValues, sha256Digest } from './BrowserCrypto.mjs';\nimport { pkceNotCreated } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Constant byte array length\r\nconst RANDOM_BYTE_ARR_LENGTH = 32;\r\n/**\r\n * This file defines APIs to generate PKCE codes and code verifiers.\r\n */\r\n/**\r\n * Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636\r\n */\r\nasync function generatePkceCodes(performanceClient, logger, correlationId) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.GeneratePkceCodes, correlationId);\r\n const codeVerifier = invoke(generateCodeVerifier, PerformanceEvents.GenerateCodeVerifier, logger, performanceClient, correlationId)(performanceClient, logger, correlationId);\r\n const codeChallenge = await invokeAsync(generateCodeChallengeFromVerifier, PerformanceEvents.GenerateCodeChallengeFromVerifier, logger, performanceClient, correlationId)(codeVerifier, performanceClient, logger, correlationId);\r\n return {\r\n verifier: codeVerifier,\r\n challenge: codeChallenge,\r\n };\r\n}\r\n/**\r\n * Generates a random 32 byte buffer and returns the base64\r\n * encoded string to be used as a PKCE Code Verifier\r\n */\r\nfunction generateCodeVerifier(performanceClient, logger, correlationId) {\r\n try {\r\n // Generate random values as utf-8\r\n const buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);\r\n invoke(getRandomValues, PerformanceEvents.GetRandomValues, logger, performanceClient, correlationId)(buffer);\r\n // encode verifier as base64\r\n const pkceCodeVerifierB64 = urlEncodeArr(buffer);\r\n return pkceCodeVerifierB64;\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(pkceNotCreated);\r\n }\r\n}\r\n/**\r\n * Creates a base64 encoded PKCE Code Challenge string from the\r\n * hash created from the PKCE Code Verifier supplied\r\n */\r\nasync function generateCodeChallengeFromVerifier(pkceCodeVerifier, performanceClient, logger, correlationId) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.GenerateCodeChallengeFromVerifier, correlationId);\r\n try {\r\n // hashed verifier\r\n const pkceHashedCodeVerifier = await invokeAsync(sha256Digest, PerformanceEvents.Sha256Digest, logger, performanceClient, correlationId)(pkceCodeVerifier, performanceClient, correlationId);\r\n // encode hash as base64\r\n return urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier));\r\n }\r\n catch (e) {\r\n throw createBrowserAuthError(pkceNotCreated);\r\n }\r\n}\n\nexport { generatePkceCodes };\n//# sourceMappingURL=PkceGenerator.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { OIDC_DEFAULT_SCOPES, invokeAsync, PerformanceEvents, invoke, ThrottlingUtils, ProtocolUtils, AuthError, ProtocolMode, UrlString, ServerResponseType } from '@azure/msal-common/browser';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { ApiId, InteractionType, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { preconnect, getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { deserializeResponse } from '../response/ResponseHandler.mjs';\nimport { getAuthCodeRequestUrl } from '../protocol/Authorize.mjs';\nimport { generatePkceCodes } from '../crypto/PkceGenerator.mjs';\nimport { nativeConnectionNotEstablished, emptyNavigateUri, userCancelled, emptyWindowError, popupWindowError } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass PopupClient extends StandardInteractionClient {\r\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n // Properly sets this reference for the unload event.\r\n this.unloadWindow = this.unloadWindow.bind(this);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n /**\r\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\r\n * @param request\r\n * @param pkceCodes\r\n */\r\n acquireToken(request, pkceCodes) {\r\n try {\r\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\r\n const popupParams = {\r\n popupName,\r\n popupWindowAttributes: request.popupWindowAttributes || {},\r\n popupWindowParent: request.popupWindowParent ?? window,\r\n };\r\n this.performanceClient.addFields({ isAsyncPopup: this.config.system.asyncPopups }, this.correlationId);\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\r\n // Passes on popup position and dimensions if in request\r\n return this.acquireTokenPopupAsync(request, popupParams, pkceCodes);\r\n }\r\n else {\r\n // asyncPopups flag is set to false. Opens popup before acquiring token.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\r\n popupParams.popup = this.openSizedPopup(\"about:blank\", popupParams);\r\n return this.acquireTokenPopupAsync(request, popupParams, pkceCodes);\r\n }\r\n }\r\n catch (e) {\r\n return Promise.reject(e);\r\n }\r\n }\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n logout(logoutRequest) {\r\n try {\r\n this.logger.verbose(\"logoutPopup called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n const popupParams = {\r\n popupName: this.generateLogoutPopupName(validLogoutRequest),\r\n popupWindowAttributes: logoutRequest?.popupWindowAttributes || {},\r\n popupWindowParent: logoutRequest?.popupWindowParent ?? window,\r\n };\r\n const authority = logoutRequest && logoutRequest.authority;\r\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true\");\r\n // Passes on popup position and dimensions if in request\r\n return this.logoutPopupAsync(validLogoutRequest, popupParams, authority, mainWindowRedirectUri);\r\n }\r\n else {\r\n // asyncPopups flag is set to false. Opens popup before logging out.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\r\n popupParams.popup = this.openSizedPopup(\"about:blank\", popupParams);\r\n return this.logoutPopupAsync(validLogoutRequest, popupParams, authority, mainWindowRedirectUri);\r\n }\r\n }\r\n catch (e) {\r\n // Since this function is synchronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n }\r\n /**\r\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\r\n * @param request\r\n * @param popupParams\r\n * @param pkceCodes\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n async acquireTokenPopupAsync(request, popupParams, pkceCodes) {\r\n this.logger.verbose(\"acquireTokenPopupAsync called\");\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\r\n const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Popup);\r\n const pkce = pkceCodes ||\r\n (await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, this.correlationId)(this.performanceClient, this.logger, this.correlationId));\r\n validRequest.codeChallenge = pkce.challenge;\r\n /*\r\n * Skip pre-connect for async popups to reduce time between user interaction and popup window creation to avoid\r\n * popup from being blocked by browsers with shorter popup timers\r\n */\r\n if (popupParams.popup) {\r\n preconnect(validRequest.authority);\r\n }\r\n try {\r\n // Initialize the client\r\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: validRequest.authority,\r\n requestAzureCloudOptions: validRequest.azureCloudOptions,\r\n requestExtraQueryParameters: validRequest.extraQueryParameters,\r\n account: validRequest.account,\r\n });\r\n const isPlatformBroker = NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\r\n // Start measurement for server calls with native brokering enabled\r\n let fetchNativeAccountIdMeasurement;\r\n if (isPlatformBroker) {\r\n fetchNativeAccountIdMeasurement =\r\n this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\r\n }\r\n // Create acquire token url.\r\n const navigateUrl = await invokeAsync(getAuthCodeRequestUrl, PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, validRequest.correlationId)(this.config, authClient.authority, {\r\n ...validRequest,\r\n platformBroker: isPlatformBroker,\r\n }, this.logger, this.performanceClient);\r\n // Show the UI once the url has been created. Get the window handle for the popup.\r\n const popupWindow = this.initiateAuthRequest(navigateUrl, popupParams);\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow }, null);\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n const responseString = await this.monitorPopupForHash(popupWindow, popupParams.popupWindowParent);\r\n const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.serverResponseType, this.logger);\r\n // Remove throttle if it exists\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, validRequest);\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n // end measurement for server call with native brokering enabled\r\n if (fetchNativeAccountIdMeasurement) {\r\n fetchNativeAccountIdMeasurement.end({\r\n success: true,\r\n isNativeBroker: true,\r\n });\r\n }\r\n if (!this.nativeMessageHandler) {\r\n throw createBrowserAuthError(nativeConnectionNotEstablished);\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, validRequest.state);\r\n return await nativeInteractionClient.acquireToken({\r\n ...validRequest,\r\n state: userRequestState,\r\n prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently\r\n });\r\n }\r\n const authCodeRequest = {\r\n ...validRequest,\r\n code: serverParams.code || \"\",\r\n codeVerifier: pkce.verifier,\r\n };\r\n // Create popup interaction handler.\r\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n // Handle response from hash string.\r\n const result = await interactionHandler.handleCodeResponse(serverParams, validRequest);\r\n return result;\r\n }\r\n catch (e) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popupParams.popup?.close();\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n throw e;\r\n }\r\n }\r\n /**\r\n *\r\n * @param validRequest\r\n * @param popupName\r\n * @param requestAuthority\r\n * @param popup\r\n * @param mainWindowRedirectUri\r\n * @param popupWindowAttributes\r\n */\r\n async logoutPopupAsync(validRequest, popupParams, requestAuthority, mainWindowRedirectUri) {\r\n this.logger.verbose(\"logoutPopupAsync called\");\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\r\n try {\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validRequest.account);\r\n // Initialize the client\r\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: requestAuthority,\r\n account: validRequest.account || undefined,\r\n });\r\n try {\r\n authClient.authority.endSessionEndpoint;\r\n }\r\n catch {\r\n if (validRequest.account?.homeAccountId &&\r\n validRequest.postLogoutRedirectUri &&\r\n authClient.authority.protocolMode === ProtocolMode.OIDC) {\r\n void this.browserStorage.removeAccount(validRequest.account?.homeAccountId);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\r\n if (mainWindowRedirectUri) {\r\n const navigationOptions = {\r\n apiId: ApiId.logoutPopup,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false,\r\n };\r\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, getCurrentUri());\r\n await this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\r\n }\r\n popupParams.popup?.close();\r\n return;\r\n }\r\n }\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri = authClient.getLogoutUri(validRequest);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\r\n // Open the popup window to requestUrl.\r\n const popupWindow = this.openPopup(logoutUri, popupParams);\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow }, null);\r\n await this.monitorPopupForHash(popupWindow, popupParams.popupWindowParent).catch(() => {\r\n // Swallow any errors related to monitoring the window. Server logout is best effort\r\n });\r\n if (mainWindowRedirectUri) {\r\n const navigationOptions = {\r\n apiId: ApiId.logoutPopup,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false,\r\n };\r\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, getCurrentUri());\r\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\r\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\r\n await this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\r\n }\r\n else {\r\n this.logger.verbose(\"No main window navigation requested\");\r\n }\r\n }\r\n catch (e) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popupParams.popup?.close();\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n throw e;\r\n }\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n }\r\n /**\r\n * Opens a popup window with given request Url.\r\n * @param requestUrl\r\n */\r\n initiateAuthRequest(requestUrl, params) {\r\n // Check that request url is not empty.\r\n if (requestUrl) {\r\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\r\n // Open the popup window to requestUrl.\r\n return this.openPopup(requestUrl, params);\r\n }\r\n else {\r\n // Throw error if request URL is empty.\r\n this.logger.error(\"Navigate url is empty\");\r\n throw createBrowserAuthError(emptyNavigateUri);\r\n }\r\n }\r\n /**\r\n * Monitors a window until it loads a url with the same origin.\r\n * @param popupWindow - window that is being monitored\r\n * @param timeout - timeout for processing hash once popup is redirected back to application\r\n */\r\n monitorPopupForHash(popupWindow, popupWindowParent) {\r\n return new Promise((resolve, reject) => {\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\r\n const intervalId = setInterval(() => {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\r\n clearInterval(intervalId);\r\n reject(createBrowserAuthError(userCancelled));\r\n return;\r\n }\r\n let href = \"\";\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n }\r\n catch (e) { }\r\n // Don't process blank pages or cross domain\r\n if (!href || href === \"about:blank\") {\r\n return;\r\n }\r\n clearInterval(intervalId);\r\n let responseString = \"\";\r\n const responseType = this.config.auth.OIDCOptions.serverResponseType;\r\n if (popupWindow) {\r\n if (responseType === ServerResponseType.QUERY) {\r\n responseString = popupWindow.location.search;\r\n }\r\n else {\r\n responseString = popupWindow.location.hash;\r\n }\r\n }\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\r\n resolve(responseString);\r\n }, this.config.system.pollIntervalMilliseconds);\r\n }).finally(() => {\r\n this.cleanPopup(popupWindow, popupWindowParent);\r\n });\r\n }\r\n /**\r\n * @hidden\r\n *\r\n * Configures popup window for login.\r\n *\r\n * @param urlNavigate\r\n * @param title\r\n * @param popUpWidth\r\n * @param popUpHeight\r\n * @param popupWindowAttributes\r\n * @ignore\r\n * @hidden\r\n */\r\n openPopup(urlNavigate, popupParams) {\r\n try {\r\n let popupWindow;\r\n // Popup window passed in, setting url to navigate to\r\n if (popupParams.popup) {\r\n popupWindow = popupParams.popup;\r\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\r\n popupWindow.location.assign(urlNavigate);\r\n }\r\n else if (typeof popupParams.popup === \"undefined\") {\r\n // Popup will be undefined if it was not passed in\r\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\r\n popupWindow = this.openSizedPopup(urlNavigate, popupParams);\r\n }\r\n // Popup will be null if popups are blocked\r\n if (!popupWindow) {\r\n throw createBrowserAuthError(emptyWindowError);\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n this.currentWindow = popupWindow;\r\n popupParams.popupWindowParent.addEventListener(\"beforeunload\", this.unloadWindow);\r\n return popupWindow;\r\n }\r\n catch (e) {\r\n this.logger.error(\"error opening popup \" + e.message);\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw createBrowserAuthError(popupWindowError);\r\n }\r\n }\r\n /**\r\n * Helper function to set popup window dimensions and position\r\n * @param urlNavigate\r\n * @param popupName\r\n * @param popupWindowAttributes\r\n * @returns\r\n */\r\n openSizedPopup(urlNavigate, { popupName, popupWindowAttributes, popupWindowParent }) {\r\n /**\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = popupWindowParent.screenLeft\r\n ? popupWindowParent.screenLeft\r\n : popupWindowParent.screenX;\r\n const winTop = popupWindowParent.screenTop\r\n ? popupWindowParent.screenTop\r\n : popupWindowParent.screenY;\r\n /**\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const winWidth = popupWindowParent.innerWidth ||\r\n document.documentElement.clientWidth ||\r\n document.body.clientWidth;\r\n const winHeight = popupWindowParent.innerHeight ||\r\n document.documentElement.clientHeight ||\r\n document.body.clientHeight;\r\n let width = popupWindowAttributes.popupSize?.width;\r\n let height = popupWindowAttributes.popupSize?.height;\r\n let top = popupWindowAttributes.popupPosition?.top;\r\n let left = popupWindowAttributes.popupPosition?.left;\r\n if (!width || width < 0 || width > winWidth) {\r\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\r\n width = BrowserConstants.POPUP_WIDTH;\r\n }\r\n if (!height || height < 0 || height > winHeight) {\r\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\r\n height = BrowserConstants.POPUP_HEIGHT;\r\n }\r\n if (!top || top < 0 || top > winHeight) {\r\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\r\n top = Math.max(0, winHeight / 2 - BrowserConstants.POPUP_HEIGHT / 2 + winTop);\r\n }\r\n if (!left || left < 0 || left > winWidth) {\r\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\r\n left = Math.max(0, winWidth / 2 - BrowserConstants.POPUP_WIDTH / 2 + winLeft);\r\n }\r\n return popupWindowParent.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\r\n }\r\n /**\r\n * Event callback to unload main window.\r\n */\r\n unloadWindow(e) {\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\r\n if (this.currentWindow) {\r\n this.currentWindow.close();\r\n }\r\n // Guarantees browser unload will happen, so no other errors will be thrown.\r\n e.preventDefault();\r\n }\r\n /**\r\n * Closes popup, removes any state vars created during popup calls.\r\n * @param popupWindow\r\n */\r\n cleanPopup(popupWindow, popupWindowParent) {\r\n // Close window.\r\n popupWindow.close();\r\n // Remove window unload function\r\n popupWindowParent.removeEventListener(\"beforeunload\", this.unloadWindow);\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n }\r\n /**\r\n * Generates the name for the popup based on the client id and request\r\n * @param clientId\r\n * @param request\r\n */\r\n generatePopupName(scopes, authority) {\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\r\n }\r\n /**\r\n * Generates the name for the popup based on the client id and request for logouts\r\n * @param clientId\r\n * @param request\r\n */\r\n generateLogoutPopupName(request) {\r\n const homeAccountId = request.account && request.account.homeAccountId;\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\r\n }\r\n}\n\nexport { PopupClient };\n//# sourceMappingURL=PopupClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createClientAuthError, ClientAuthErrorCodes, AuthorizeProtocol, ServerError, invokeAsync, PerformanceEvents } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.mjs';\nimport { emptyNavigateUri, userCancelled } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass RedirectHandler {\r\n constructor(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {\r\n this.authModule = authCodeModule;\r\n this.browserStorage = storageImpl;\r\n this.authCodeRequest = authCodeRequest;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Redirects window to given URL.\r\n * @param urlNavigate\r\n */\r\n async initiateAuthRequest(requestUrl, params) {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest called\");\r\n // Navigate if valid URL\r\n if (requestUrl) {\r\n // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true\r\n if (params.redirectStartPage) {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page\");\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);\r\n }\r\n // Set interaction status in the library.\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);\r\n this.browserStorage.cacheCodeRequest(this.authCodeRequest);\r\n this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);\r\n const navigationOptions = {\r\n apiId: ApiId.acquireTokenRedirect,\r\n timeout: params.redirectTimeout,\r\n noHistory: false,\r\n };\r\n // If onRedirectNavigate is implemented, invoke it and provide requestUrl\r\n if (typeof params.onRedirectNavigate === \"function\") {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback\");\r\n const navigate = params.onRedirectNavigate(requestUrl);\r\n // Returning false from onRedirectNavigate will stop navigation\r\n if (navigate !== false) {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating\");\r\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\r\n return;\r\n }\r\n else {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation\");\r\n return;\r\n }\r\n }\r\n else {\r\n // Navigate window to request URL\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Navigating window to navigate url\");\r\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\r\n return;\r\n }\r\n }\r\n else {\r\n // Throw error if request URL is empty.\r\n this.logger.info(\"RedirectHandler.initiateAuthRequest: Navigate url is empty\");\r\n throw createBrowserAuthError(emptyNavigateUri);\r\n }\r\n }\r\n /**\r\n * Handle authorization code response in the window.\r\n * @param hash\r\n */\r\n async handleCodeResponse(response, state) {\r\n this.logger.verbose(\"RedirectHandler.handleCodeResponse called\");\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n // Handle code response.\r\n const stateKey = this.browserStorage.generateStateKey(state);\r\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\r\n if (!requestState) {\r\n throw createClientAuthError(ClientAuthErrorCodes.stateNotFound, \"Cached State\");\r\n }\r\n let authCodeResponse;\r\n try {\r\n authCodeResponse = AuthorizeProtocol.getAuthorizationCodePayload(response, requestState);\r\n }\r\n catch (e) {\r\n if (e instanceof ServerError &&\r\n e.subError === userCancelled) {\r\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\r\n throw createBrowserAuthError(userCancelled);\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n // Get cached items\r\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\r\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\r\n // Assign code to request\r\n this.authCodeRequest.code = authCodeResponse.code;\r\n // Check for new cloud instance\r\n if (authCodeResponse.cloud_instance_host_name) {\r\n await invokeAsync(this.authModule.updateAuthority.bind(this.authModule), PerformanceEvents.UpdateTokenEndpointAuthority, this.logger, this.performanceClient, this.authCodeRequest.correlationId)(authCodeResponse.cloud_instance_host_name, this.authCodeRequest.correlationId);\r\n }\r\n authCodeResponse.nonce = cachedNonce || undefined;\r\n authCodeResponse.state = requestState;\r\n // Add CCS parameters if available\r\n if (authCodeResponse.client_info) {\r\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\r\n }\r\n else {\r\n const cachedCcsCred = this.checkCcsCredentials();\r\n if (cachedCcsCred) {\r\n this.authCodeRequest.ccsCredential = cachedCcsCred;\r\n }\r\n }\r\n // Acquire token with retrieved code.\r\n const tokenResponse = (await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse));\r\n this.browserStorage.cleanRequestByState(state);\r\n return tokenResponse;\r\n }\r\n /**\r\n * Looks up ccs creds in the cache\r\n */\r\n checkCcsCredentials() {\r\n // Look up ccs credential in temp cache\r\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\r\n if (cachedCcsCred) {\r\n try {\r\n return JSON.parse(cachedCcsCred);\r\n }\r\n catch (e) {\r\n this.authModule.logger.error(\"Cache credential could not be parsed\");\r\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\r\n }\r\n }\r\n return null;\r\n }\r\n}\n\nexport { RedirectHandler };\n//# sourceMappingURL=RedirectHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { invokeAsync, PerformanceEvents, AuthError, Constants, UrlString, UrlUtils, ProtocolUtils, ThrottlingUtils, ProtocolMode, ServerResponseType } from '@azure/msal-common/browser';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { InteractionType, ApiId, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';\nimport { RedirectHandler } from '../interaction_handler/RedirectHandler.mjs';\nimport { replaceHash, isInIframe, getHomepage, clearHash, getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { validateInteractionType } from '../response/ResponseHandler.mjs';\nimport { getAuthCodeRequestUrl } from '../protocol/Authorize.mjs';\nimport { generatePkceCodes } from '../crypto/PkceGenerator.mjs';\nimport { noStateInHash, nativeConnectionNotEstablished, noCachedAuthorityError } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction getNavigationType() {\r\n if (typeof window === \"undefined\" ||\r\n typeof window.performance === \"undefined\" ||\r\n typeof window.performance.getEntriesByType !== \"function\") {\r\n return undefined;\r\n }\r\n const navigationEntries = window.performance.getEntriesByType(\"navigation\");\r\n const navigation = navigationEntries.length\r\n ? navigationEntries[0]\r\n : undefined;\r\n return navigation?.type;\r\n}\r\nclass RedirectClient extends StandardInteractionClient {\r\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n /**\r\n * Redirects the page to the /authorize endpoint of the IDP\r\n * @param request\r\n */\r\n async acquireToken(request) {\r\n const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Redirect);\r\n const pkceCodes = await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, this.correlationId)(this.performanceClient, this.logger, this.correlationId);\r\n validRequest.codeChallenge = pkceCodes.challenge;\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || \"\", validRequest.account || null);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\r\n const handleBackButton = (event) => {\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n if (event.persisted) {\r\n this.logger.verbose(\"Page was restored from back/forward cache. Clearing temporary cache.\");\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, InteractionType.Redirect);\r\n }\r\n };\r\n try {\r\n // Initialize the client\r\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: validRequest.authority,\r\n requestAzureCloudOptions: validRequest.azureCloudOptions,\r\n requestExtraQueryParameters: validRequest.extraQueryParameters,\r\n account: validRequest.account,\r\n });\r\n const authCodeRequest = {\r\n ...validRequest,\r\n code: \"\",\r\n codeVerifier: pkceCodes.verifier,\r\n };\r\n // Create redirect interaction handler.\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n // Create acquire token url.\r\n const navigateUrl = await invokeAsync(getAuthCodeRequestUrl, PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, validRequest.correlationId)(this.config, authClient.authority, {\r\n ...validRequest,\r\n platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme),\r\n }, this.logger, this.performanceClient);\r\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\r\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n window.addEventListener(\"pageshow\", handleBackButton);\r\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\r\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\r\n navigationClient: this.navigationClient,\r\n redirectTimeout: this.config.system.redirectNavigationTimeout,\r\n redirectStartPage: redirectStartPage,\r\n onRedirectNavigate: request.onRedirectNavigate ||\r\n this.config.auth.onRedirectNavigate,\r\n });\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n window.removeEventListener(\"pageshow\", handleBackButton);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Checks if navigateToLoginRequestUrl is set, and:\r\n * - if true, performs logic to cache and navigate\r\n * - if false, handles hash string and parses response\r\n * @param hash {string} url hash\r\n * @param parentMeasurement {InProgressPerformanceEvent} parent measurement\r\n */\r\n async handleRedirectPromise(hash = \"\", parentMeasurement) {\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\r\n try {\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return null;\r\n }\r\n const [serverParams, responseString] = this.getRedirectResponse(hash || \"\");\r\n if (!serverParams) {\r\n // Not a recognized server response hash or hash not associated with a redirect request\r\n this.logger.info(\"handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.\");\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n // Do not instrument \"no_server_response\" if user clicked back button\r\n if (getNavigationType() !== \"back_forward\") {\r\n parentMeasurement.event.errorCode = \"no_server_response\";\r\n }\r\n else {\r\n this.logger.verbose(\"Back navigation event detected. Muting no_server_response error\");\r\n }\r\n return null;\r\n }\r\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\r\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;\r\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\r\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\r\n if (loginRequestUrlNormalized === currentUrlNormalized &&\r\n this.config.auth.navigateToLoginRequestUrl) {\r\n // We are on the page we need to navigate to - handle hash\r\n this.logger.verbose(\"Current page is loginRequestUrl, handling response\");\r\n if (loginRequestUrl.indexOf(\"#\") > -1) {\r\n // Replace current hash with non-msal hash, if present\r\n replaceHash(loginRequestUrl);\r\n }\r\n const handleHashResult = await this.handleResponse(serverParams, serverTelemetryManager);\r\n return handleHashResult;\r\n }\r\n else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling response\");\r\n return await this.handleResponse(serverParams, serverTelemetryManager);\r\n }\r\n else if (!isInIframe() ||\r\n this.config.system.allowRedirectInIframe) {\r\n /*\r\n * Returned from authority using redirect - need to perform navigation before processing response\r\n * Cache the hash to be retrieved after the next redirect\r\n */\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseString, true);\r\n const navigationOptions = {\r\n apiId: ApiId.handleRedirectPromise,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: true,\r\n };\r\n /**\r\n * Default behavior is to redirect to the start page and not process the hash now.\r\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\r\n */\r\n let processHashOnRedirect = true;\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n const homepage = getHomepage();\r\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\r\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n processHashOnRedirect =\r\n await this.navigationClient.navigateInternal(homepage, navigationOptions);\r\n }\r\n else {\r\n // Navigate to page that initiated the redirect request\r\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\r\n processHashOnRedirect =\r\n await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\r\n }\r\n // If navigateInternal implementation returns false, handle the hash now\r\n if (!processHashOnRedirect) {\r\n return await this.handleResponse(serverParams, serverTelemetryManager);\r\n }\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Gets the response hash for a redirect request\r\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\r\n * @param hash\r\n */\r\n getRedirectResponse(userProvidedResponse) {\r\n this.logger.verbose(\"getRedirectResponseHash called\");\r\n // Get current location hash from window or cache.\r\n let responseString = userProvidedResponse;\r\n if (!responseString) {\r\n if (this.config.auth.OIDCOptions.serverResponseType ===\r\n ServerResponseType.QUERY) {\r\n responseString = window.location.search;\r\n }\r\n else {\r\n responseString = window.location.hash;\r\n }\r\n }\r\n let response = UrlUtils.getDeserializedResponse(responseString);\r\n if (response) {\r\n try {\r\n validateInteractionType(response, this.browserCrypto, InteractionType.Redirect);\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`);\r\n }\r\n return [null, \"\"];\r\n }\r\n clearHash(window);\r\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\r\n return [response, responseString];\r\n }\r\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n if (cachedHash) {\r\n response = UrlUtils.getDeserializedResponse(cachedHash);\r\n if (response) {\r\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\r\n return [response, cachedHash];\r\n }\r\n }\r\n return [null, \"\"];\r\n }\r\n /**\r\n * Checks if hash exists and handles in window.\r\n * @param hash\r\n * @param state\r\n */\r\n async handleResponse(serverParams, serverTelemetryManager) {\r\n const state = serverParams.state;\r\n if (!state) {\r\n throw createBrowserAuthError(noStateInHash);\r\n }\r\n const cachedRequest = this.browserStorage.getCachedRequest(state);\r\n this.logger.verbose(\"handleResponse called, retrieved cached request\");\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw createBrowserAuthError(nativeConnectionNotEstablished);\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient\r\n .acquireToken({\r\n ...cachedRequest,\r\n state: userRequestState,\r\n prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently\r\n })\r\n .finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n // Hash contains known properties - handle and return in callback\r\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\r\n if (!currentAuthority) {\r\n throw createBrowserAuthError(noCachedAuthorityError);\r\n }\r\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({ serverTelemetryManager, requestAuthority: currentAuthority });\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.performanceClient);\r\n return interactionHandler.handleCodeResponse(serverParams, state);\r\n }\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n async logout(logoutRequest) {\r\n this.logger.verbose(\"logoutRedirect called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\r\n try {\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validLogoutRequest.account);\r\n const navigationOptions = {\r\n apiId: ApiId.logout,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false,\r\n };\r\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: logoutRequest && logoutRequest.authority,\r\n requestExtraQueryParameters: logoutRequest?.extraQueryParameters,\r\n account: (logoutRequest && logoutRequest.account) || undefined,\r\n });\r\n if (authClient.authority.protocolMode === ProtocolMode.OIDC) {\r\n try {\r\n authClient.authority.endSessionEndpoint;\r\n }\r\n catch {\r\n if (validLogoutRequest.account?.homeAccountId) {\r\n void this.browserStorage.removeAccount(validLogoutRequest.account?.homeAccountId);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n return;\r\n }\r\n }\r\n }\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri = authClient.getLogoutUri(validLogoutRequest);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n // Check if onRedirectNavigate is implemented, and invoke it if so\r\n if (logoutRequest &&\r\n typeof logoutRequest.onRedirectNavigate === \"function\") {\r\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\r\n if (navigate !== false) {\r\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n }\r\n else {\r\n // Ensure interaction is not in progress\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n }\r\n else {\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n }\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n throw e;\r\n }\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n }\r\n /**\r\n * Use to get the redirectStartPage either from request or use current window\r\n * @param requestStartPage\r\n */\r\n getRedirectStartPage(requestStartPage) {\r\n const redirectStartPage = requestStartPage || window.location.href;\r\n return UrlString.getAbsoluteUrl(redirectStartPage, getCurrentUri());\r\n }\r\n}\n\nexport { RedirectClient };\n//# sourceMappingURL=RedirectClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, invokeAsync, invoke, ServerResponseType } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { DEFAULT_IFRAME_TIMEOUT_MS } from '../config/Configuration.mjs';\nimport { emptyNavigateUri, monitorWindowTimeout } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Creates a hidden iframe to given URL using user-requested scopes as an id.\r\n * @param urlNavigate\r\n * @param userRequestScopes\r\n */\r\nasync function initiateAuthRequest(requestUrl, performanceClient, logger, correlationId, navigateFrameWait) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, correlationId);\r\n if (!requestUrl) {\r\n // Throw error if request URL is empty.\r\n logger.info(\"Navigate url is empty\");\r\n throw createBrowserAuthError(emptyNavigateUri);\r\n }\r\n if (navigateFrameWait) {\r\n return invokeAsync(loadFrame, PerformanceEvents.SilentHandlerLoadFrame, logger, performanceClient, correlationId)(requestUrl, navigateFrameWait, performanceClient, correlationId);\r\n }\r\n return invoke(loadFrameSync, PerformanceEvents.SilentHandlerLoadFrameSync, logger, performanceClient, correlationId)(requestUrl);\r\n}\r\n/**\r\n * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.\r\n * @param iframe\r\n * @param timeout\r\n */\r\nasync function monitorIframeForHash(iframe, timeout, pollIntervalMilliseconds, performanceClient, logger, correlationId, responseType) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerMonitorIframeForHash, correlationId);\r\n return new Promise((resolve, reject) => {\r\n if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {\r\n logger.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${timeout}ms) than the default (${DEFAULT_IFRAME_TIMEOUT_MS}ms). This may result in timeouts.`);\r\n }\r\n /*\r\n * Polling for iframes can be purely timing based,\r\n * since we don't need to account for interaction.\r\n */\r\n const timeoutId = window.setTimeout(() => {\r\n window.clearInterval(intervalId);\r\n reject(createBrowserAuthError(monitorWindowTimeout));\r\n }, timeout);\r\n const intervalId = window.setInterval(() => {\r\n let href = \"\";\r\n const contentWindow = iframe.contentWindow;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = contentWindow ? contentWindow.location.href : \"\";\r\n }\r\n catch (e) { }\r\n if (!href || href === \"about:blank\") {\r\n return;\r\n }\r\n let responseString = \"\";\r\n if (contentWindow) {\r\n if (responseType === ServerResponseType.QUERY) {\r\n responseString = contentWindow.location.search;\r\n }\r\n else {\r\n responseString = contentWindow.location.hash;\r\n }\r\n }\r\n window.clearTimeout(timeoutId);\r\n window.clearInterval(intervalId);\r\n resolve(responseString);\r\n }, pollIntervalMilliseconds);\r\n }).finally(() => {\r\n invoke(removeHiddenIframe, PerformanceEvents.RemoveHiddenIframe, logger, performanceClient, correlationId)(iframe);\r\n });\r\n}\r\n/**\r\n * @hidden\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n * @deprecated\r\n */\r\nfunction loadFrame(urlNavigate, navigateFrameWait, performanceClient, correlationId) {\r\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerLoadFrame, correlationId);\r\n /*\r\n * This trick overcomes iframe navigation in IE\r\n * IE does not load the page consistently in iframe\r\n */\r\n return new Promise((resolve, reject) => {\r\n const frameHandle = createHiddenIframe();\r\n window.setTimeout(() => {\r\n if (!frameHandle) {\r\n reject(\"Unable to load iframe\");\r\n return;\r\n }\r\n frameHandle.src = urlNavigate;\r\n resolve(frameHandle);\r\n }, navigateFrameWait);\r\n });\r\n}\r\n/**\r\n * @hidden\r\n * Loads the iframe synchronously when the navigateTimeFrame is set to `0`\r\n * @param urlNavigate\r\n * @param frameName\r\n * @param logger\r\n */\r\nfunction loadFrameSync(urlNavigate) {\r\n const frameHandle = createHiddenIframe();\r\n frameHandle.src = urlNavigate;\r\n return frameHandle;\r\n}\r\n/**\r\n * @hidden\r\n * Creates a new hidden iframe or gets an existing one for silent token renewal.\r\n * @ignore\r\n */\r\nfunction createHiddenIframe() {\r\n const authFrame = document.createElement(\"iframe\");\r\n authFrame.className = \"msalSilentIframe\";\r\n authFrame.style.visibility = \"hidden\";\r\n authFrame.style.position = \"absolute\";\r\n authFrame.style.width = authFrame.style.height = \"0\";\r\n authFrame.style.border = \"0\";\r\n authFrame.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\r\n document.body.appendChild(authFrame);\r\n return authFrame;\r\n}\r\n/**\r\n * @hidden\r\n * Removes a hidden iframe from the page.\r\n * @ignore\r\n */\r\nfunction removeHiddenIframe(iframe) {\r\n if (document.body === iframe.parentNode) {\r\n document.body.removeChild(iframe);\r\n }\r\n}\n\nexport { initiateAuthRequest, monitorIframeForHash };\n//# sourceMappingURL=SilentHandler.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { PerformanceEvents, PromptValue, invokeAsync, AuthError, invoke, ProtocolUtils } from '@azure/msal-common/browser';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionType, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { initiateAuthRequest, monitorIframeForHash } from '../interaction_handler/SilentHandler.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { preconnect } from '../utils/BrowserUtils.mjs';\nimport { deserializeResponse } from '../response/ResponseHandler.mjs';\nimport { getAuthCodeRequestUrl } from '../protocol/Authorize.mjs';\nimport { generatePkceCodes } from '../crypto/PkceGenerator.mjs';\nimport { silentLogoutUnsupported, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass SilentIframeClient extends StandardInteractionClient {\r\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n /**\r\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\r\n * @param request\r\n */\r\n async acquireToken(request) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n // Check that we have some SSO data\r\n if (!request.loginHint &&\r\n !request.sid &&\r\n (!request.account || !request.account.username)) {\r\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\r\n }\r\n // Check the prompt value\r\n const inputRequest = { ...request };\r\n if (inputRequest.prompt) {\r\n if (inputRequest.prompt !== PromptValue.NONE &&\r\n inputRequest.prompt !== PromptValue.NO_SESSION) {\r\n this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${inputRequest.prompt} with ${PromptValue.NONE}`);\r\n inputRequest.prompt = PromptValue.NONE;\r\n }\r\n }\r\n else {\r\n inputRequest.prompt = PromptValue.NONE;\r\n }\r\n // Create silent request\r\n const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(inputRequest, InteractionType.Silent);\r\n preconnect(silentRequest.authority);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n let authClient;\r\n try {\r\n // Initialize the client\r\n authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, request.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: silentRequest.authority,\r\n requestAzureCloudOptions: silentRequest.azureCloudOptions,\r\n requestExtraQueryParameters: silentRequest.extraQueryParameters,\r\n account: silentRequest.account,\r\n });\r\n return await invokeAsync(this.silentTokenHelper.bind(this), PerformanceEvents.SilentIframeClientTokenHelper, this.logger, this.performanceClient, request.correlationId)(authClient, silentRequest);\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n if (!authClient ||\r\n !(e instanceof AuthError) ||\r\n e.errorCode !== BrowserConstants.INVALID_GRANT_ERROR) {\r\n throw e;\r\n }\r\n this.performanceClient.addFields({\r\n retryError: e.errorCode,\r\n }, this.correlationId);\r\n const retrySilentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(inputRequest, InteractionType.Silent);\r\n return await invokeAsync(this.silentTokenHelper.bind(this), PerformanceEvents.SilentIframeClientTokenHelper, this.logger, this.performanceClient, this.correlationId)(authClient, retrySilentRequest);\r\n }\r\n }\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout() {\r\n // Synchronous so we must reject\r\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\r\n }\r\n /**\r\n * Helper which acquires an authorization code silently using a hidden iframe from given url\r\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\r\n * @param navigateUrl\r\n * @param userRequestScopes\r\n */\r\n async silentTokenHelper(authClient, request) {\r\n const correlationId = request.correlationId;\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, correlationId);\r\n const pkceCodes = await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, this.correlationId)(this.performanceClient, this.logger, this.correlationId);\r\n const silentRequest = {\r\n ...request,\r\n codeChallenge: pkceCodes.challenge,\r\n };\r\n // Create authorize request url\r\n const navigateUrl = await invokeAsync(getAuthCodeRequestUrl, PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)(this.config, authClient.authority, {\r\n ...silentRequest,\r\n platformBroker: NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),\r\n }, this.logger, this.performanceClient);\r\n // Get the frame handle for the silent request\r\n const msalFrame = await invokeAsync(initiateAuthRequest, PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(navigateUrl, this.performanceClient, this.logger, correlationId, this.config.system.navigateFrameWait);\r\n const responseType = this.config.auth.OIDCOptions.serverResponseType;\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n const responseString = await invokeAsync(monitorIframeForHash, PerformanceEvents.SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(msalFrame, this.config.system.iframeHashTimeout, this.config.system.pollIntervalMilliseconds, this.performanceClient, this.logger, correlationId, responseType);\r\n const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, responseType, this.logger);\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw createBrowserAuthError(nativeConnectionNotEstablished);\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, silentRequest.state);\r\n return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)({\r\n ...silentRequest,\r\n state: userRequestState,\r\n prompt: silentRequest.prompt || PromptValue.NONE,\r\n });\r\n }\r\n const authCodeRequest = {\r\n ...silentRequest,\r\n code: serverParams.code || \"\",\r\n codeVerifier: pkceCodes.verifier,\r\n };\r\n // Create silent handler\r\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n // Handle response from hash string\r\n return invokeAsync(interactionHandler.handleCodeResponse.bind(interactionHandler), PerformanceEvents.HandleCodeResponse, this.logger, this.performanceClient, correlationId)(serverParams, silentRequest);\r\n }\r\n}\n\nexport { SilentIframeClient };\n//# sourceMappingURL=SilentIframeClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { PerformanceEvents, invokeAsync, RefreshTokenClient } from '@azure/msal-common/browser';\nimport { ApiId } from '../utils/BrowserConstants.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { initializeBaseRequest } from '../request/RequestHelpers.mjs';\nimport { silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass SilentRefreshClient extends StandardInteractionClient {\r\n /**\r\n * Exchanges the refresh token for new tokens\r\n * @param request\r\n */\r\n async acquireToken(request) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);\r\n const baseRequest = await invokeAsync(initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request, this.config, this.performanceClient, this.logger);\r\n const silentRequest = {\r\n ...request,\r\n ...baseRequest,\r\n };\r\n if (request.redirectUri) {\r\n // Make sure any passed redirectUri is converted to an absolute URL - redirectUri is not a required parameter for refresh token redemption so only include if explicitly provided\r\n silentRequest.redirectUri = this.getRedirectUri(request.redirectUri);\r\n }\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n const refreshTokenClient = await this.createRefreshTokenClient({\r\n serverTelemetryManager,\r\n authorityUrl: silentRequest.authority,\r\n azureCloudOptions: silentRequest.azureCloudOptions,\r\n account: silentRequest.account,\r\n });\r\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\r\n return invokeAsync(refreshTokenClient.acquireTokenByRefreshToken.bind(refreshTokenClient), PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, this.logger, this.performanceClient, request.correlationId)(silentRequest).catch((e) => {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n throw e;\r\n });\r\n }\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout() {\r\n // Synchronous so we must reject\r\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\r\n }\r\n /**\r\n * Creates a Refresh Client with the given authority, or the default authority.\r\n * @param params {\r\n * serverTelemetryManager: ServerTelemetryManager;\r\n * authorityUrl?: string;\r\n * azureCloudOptions?: AzureCloudOptions;\r\n * extraQueryParams?: StringDict;\r\n * account?: AccountInfo;\r\n * }\r\n */\r\n async createRefreshTokenClient(params) {\r\n // Create auth module.\r\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)({\r\n serverTelemetryManager: params.serverTelemetryManager,\r\n requestAuthority: params.authorityUrl,\r\n requestAzureCloudOptions: params.azureCloudOptions,\r\n requestExtraQueryParameters: params.extraQueryParameters,\r\n account: params.account,\r\n });\r\n return new RefreshTokenClient(clientConfig, this.performanceClient);\r\n }\r\n}\n\nexport { SilentRefreshClient };\n//# sourceMappingURL=SilentRefreshClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AuthToken, Authority, AccountEntity, buildAccountToCache, CacheHelpers, ScopeSet, TimeUtils } from '@azure/msal-common/browser';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { nonBrowserEnvironment, unableToLoadToken } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Token cache manager\r\n */\r\nclass TokenCache {\r\n constructor(configuration, storage, logger, cryptoObj) {\r\n this.isBrowserEnvironment = typeof window !== \"undefined\";\r\n this.config = configuration;\r\n this.storage = storage;\r\n this.logger = logger;\r\n this.cryptoObj = cryptoObj;\r\n }\r\n // Move getAllAccounts here and cache utility APIs\r\n /**\r\n * API to load tokens to msal-browser cache.\r\n * @param request\r\n * @param response\r\n * @param options\r\n * @returns `AuthenticationResult` for the response that was loaded.\r\n */\r\n async loadExternalTokens(request, response, options) {\r\n if (!this.isBrowserEnvironment) {\r\n throw createBrowserAuthError(nonBrowserEnvironment);\r\n }\r\n const correlationId = request.correlationId || createNewGuid();\r\n const idTokenClaims = response.id_token\r\n ? AuthToken.extractTokenClaims(response.id_token, base64Decode)\r\n : undefined;\r\n const authorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata,\r\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\r\n };\r\n const authority = request.authority\r\n ? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())\r\n : undefined;\r\n const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || \"\", correlationId, idTokenClaims, authority);\r\n const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, correlationId);\r\n const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options, correlationId);\r\n const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, correlationId);\r\n return this.generateAuthenticationResult(request, {\r\n account: cacheRecordAccount,\r\n idToken,\r\n accessToken,\r\n refreshToken,\r\n }, idTokenClaims, authority);\r\n }\r\n /**\r\n * Helper function to load account to msal-browser cache\r\n * @param idToken\r\n * @param environment\r\n * @param clientInfo\r\n * @param authorityType\r\n * @param requestHomeAccountId\r\n * @returns `AccountEntity`\r\n */\r\n async loadAccount(request, clientInfo, correlationId, idTokenClaims, authority) {\r\n this.logger.verbose(\"TokenCache - loading account\");\r\n if (request.account) {\r\n const accountEntity = AccountEntity.createFromAccountInfo(request.account);\r\n await this.storage.setAccount(accountEntity, correlationId);\r\n return accountEntity;\r\n }\r\n else if (!authority || (!clientInfo && !idTokenClaims)) {\r\n this.logger.error(\"TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead.\");\r\n throw createBrowserAuthError(unableToLoadToken);\r\n }\r\n const homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);\r\n const claimsTenantId = idTokenClaims?.tid;\r\n const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload\r\n undefined, // nativeAccountId\r\n this.logger);\r\n await this.storage.setAccount(cachedAccount, correlationId);\r\n return cachedAccount;\r\n }\r\n /**\r\n * Helper function to load id tokens to msal-browser cache\r\n * @param idToken\r\n * @param homeAccountId\r\n * @param environment\r\n * @param tenantId\r\n * @returns `IdTokenEntity`\r\n */\r\n async loadIdToken(response, homeAccountId, environment, tenantId, correlationId) {\r\n if (!response.id_token) {\r\n this.logger.verbose(\"TokenCache - no id token found in response\");\r\n return null;\r\n }\r\n this.logger.verbose(\"TokenCache - loading id token\");\r\n const idTokenEntity = CacheHelpers.createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);\r\n await this.storage.setIdTokenCredential(idTokenEntity, correlationId);\r\n return idTokenEntity;\r\n }\r\n /**\r\n * Helper function to load access tokens to msal-browser cache\r\n * @param request\r\n * @param response\r\n * @param homeAccountId\r\n * @param environment\r\n * @param tenantId\r\n * @returns `AccessTokenEntity`\r\n */\r\n async loadAccessToken(request, response, homeAccountId, environment, tenantId, options, correlationId) {\r\n if (!response.access_token) {\r\n this.logger.verbose(\"TokenCache - no access token found in response\");\r\n return null;\r\n }\r\n else if (!response.expires_in) {\r\n this.logger.error(\"TokenCache - no expiration set on the access token. Cannot add it to the cache.\");\r\n return null;\r\n }\r\n else if (!response.scope &&\r\n (!request.scopes || !request.scopes.length)) {\r\n this.logger.error(\"TokenCache - scopes not specified in the request or response. Cannot add token to the cache.\");\r\n return null;\r\n }\r\n this.logger.verbose(\"TokenCache - loading access token\");\r\n const scopes = response.scope\r\n ? ScopeSet.fromString(response.scope)\r\n : new ScopeSet(request.scopes);\r\n const expiresOn = options.expiresOn || response.expires_in + TimeUtils.nowSeconds();\r\n const extendedExpiresOn = options.extendedExpiresOn ||\r\n (response.ext_expires_in || response.expires_in) +\r\n TimeUtils.nowSeconds();\r\n const accessTokenEntity = CacheHelpers.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);\r\n await this.storage.setAccessTokenCredential(accessTokenEntity, correlationId);\r\n return accessTokenEntity;\r\n }\r\n /**\r\n * Helper function to load refresh tokens to msal-browser cache\r\n * @param request\r\n * @param response\r\n * @param homeAccountId\r\n * @param environment\r\n * @returns `RefreshTokenEntity`\r\n */\r\n async loadRefreshToken(response, homeAccountId, environment, correlationId) {\r\n if (!response.refresh_token) {\r\n this.logger.verbose(\"TokenCache - no refresh token found in response\");\r\n return null;\r\n }\r\n this.logger.verbose(\"TokenCache - loading refresh token\");\r\n const refreshTokenEntity = CacheHelpers.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash\r\n response.refresh_token_expires_in);\r\n await this.storage.setRefreshTokenCredential(refreshTokenEntity, correlationId);\r\n return refreshTokenEntity;\r\n }\r\n /**\r\n * Helper function to generate an `AuthenticationResult` for the result.\r\n * @param request\r\n * @param idTokenObj\r\n * @param cacheRecord\r\n * @param authority\r\n * @returns `AuthenticationResult`\r\n */\r\n generateAuthenticationResult(request, cacheRecord, idTokenClaims, authority) {\r\n let accessToken = \"\";\r\n let responseScopes = [];\r\n let expiresOn = null;\r\n let extExpiresOn;\r\n if (cacheRecord?.accessToken) {\r\n accessToken = cacheRecord.accessToken.secret;\r\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\r\n // Access token expiresOn stored in seconds, converting to Date for AuthenticationResult\r\n expiresOn = TimeUtils.toDateFromSeconds(cacheRecord.accessToken.expiresOn);\r\n extExpiresOn = TimeUtils.toDateFromSeconds(cacheRecord.accessToken.extendedExpiresOn);\r\n }\r\n const accountEntity = cacheRecord.account;\r\n return {\r\n authority: authority ? authority.canonicalAuthority : \"\",\r\n uniqueId: cacheRecord.account.localAccountId,\r\n tenantId: cacheRecord.account.realm,\r\n scopes: responseScopes,\r\n account: accountEntity.getAccountInfo(),\r\n idToken: cacheRecord.idToken?.secret || \"\",\r\n idTokenClaims: idTokenClaims || {},\r\n accessToken: accessToken,\r\n fromCache: true,\r\n expiresOn: expiresOn,\r\n correlationId: request.correlationId || \"\",\r\n requestId: \"\",\r\n extExpiresOn: extExpiresOn,\r\n familyId: cacheRecord.refreshToken?.familyId || \"\",\r\n tokenType: cacheRecord?.accessToken?.tokenType || \"\",\r\n state: request.state || \"\",\r\n cloudGraphHostName: accountEntity.cloudGraphHostName || \"\",\r\n msGraphHost: accountEntity.msGraphHost || \"\",\r\n fromNativeBroker: false,\r\n };\r\n }\r\n}\n\nexport { TokenCache };\n//# sourceMappingURL=TokenCache.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { AuthorizationCodeClient } from '@azure/msal-common/browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass HybridSpaAuthorizationCodeClient extends AuthorizationCodeClient {\r\n constructor(config) {\r\n super(config);\r\n this.includeRedirectUri = false;\r\n }\r\n}\n\nexport { HybridSpaAuthorizationCodeClient };\n//# sourceMappingURL=HybridSpaAuthorizationCodeClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { invokeAsync, PerformanceEvents, AuthError } from '@azure/msal-common/browser';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionType } from '../utils/BrowserConstants.mjs';\nimport { HybridSpaAuthorizationCodeClient } from './HybridSpaAuthorizationCodeClient.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { authCodeRequired, silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass SilentAuthCodeClient extends StandardInteractionClient {\r\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeMessageHandler, correlationId) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n }\r\n /**\r\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\r\n * @param request\r\n */\r\n async acquireToken(request) {\r\n // Auth code payload is required\r\n if (!request.code) {\r\n throw createBrowserAuthError(authCodeRequired);\r\n }\r\n // Create silent request\r\n const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(request, InteractionType.Silent);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n try {\r\n // Create auth code request (PKCE not needed)\r\n const authCodeRequest = {\r\n ...silentRequest,\r\n code: request.code,\r\n };\r\n // Initialize the client\r\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, request.correlationId)({\r\n serverTelemetryManager,\r\n requestAuthority: silentRequest.authority,\r\n requestAzureCloudOptions: silentRequest.azureCloudOptions,\r\n requestExtraQueryParameters: silentRequest.extraQueryParameters,\r\n account: silentRequest.account,\r\n });\r\n const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);\r\n this.logger.verbose(\"Auth code client created\");\r\n // Create silent handler\r\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n // Handle auth code parameters from request\r\n return await invokeAsync(interactionHandler.handleCodeResponseFromServer.bind(interactionHandler), PerformanceEvents.HandleCodeResponseFromServer, this.logger, this.performanceClient, request.correlationId)({\r\n code: request.code,\r\n msgraph_host: request.msGraphHost,\r\n cloud_graph_host_name: request.cloudGraphHostName,\r\n cloud_instance_host_name: request.cloudInstanceHostName,\r\n }, silentRequest, false);\r\n }\r\n catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n }\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout() {\r\n // Synchronous so we must reject\r\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\r\n }\r\n}\n\nexport { SilentAuthCodeClient };\n//# sourceMappingURL=SilentAuthCodeClient.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { CryptoOps } from '../crypto/CryptoOps.mjs';\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, buildStaticAuthorityOptions, PerformanceEvents, invokeAsync, InteractionRequiredAuthError, createClientAuthError, ClientAuthErrorCodes, AccountEntity, PromptValue, Constants, AuthError, getRequestThumbprint, InteractionRequiredAuthErrorCodes } from '@azure/msal-common/browser';\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';\nimport { getAllAccounts, getAccount, getAccountByUsername, getAccountByHomeId, getAccountByLocalId, setActiveAccount, getActiveAccount } from '../cache/AccountManager.mjs';\nimport { TemporaryCacheKeys, InteractionType, ApiId, CacheLookupPolicy, BrowserCacheLocation, DEFAULT_REQUEST, iFrameRenewalPolicies, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { blockAPICallsBeforeInitialize, redirectPreflightCheck, preflightCheck as preflightCheck$1, blockNonBrowserEnvironment } from '../utils/BrowserUtils.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { EventHandler } from '../event/EventHandler.mjs';\nimport { PopupClient } from '../interaction_client/PopupClient.mjs';\nimport { RedirectClient } from '../interaction_client/RedirectClient.mjs';\nimport { SilentIframeClient } from '../interaction_client/SilentIframeClient.mjs';\nimport { SilentRefreshClient } from '../interaction_client/SilentRefreshClient.mjs';\nimport { TokenCache } from '../cache/TokenCache.mjs';\nimport { NativeInteractionClient } from '../interaction_client/NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { NativeAuthError, isFatalNativeAuthError } from '../error/NativeAuthError.mjs';\nimport { SilentCacheClient } from '../interaction_client/SilentCacheClient.mjs';\nimport { SilentAuthCodeClient } from '../interaction_client/SilentAuthCodeClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { initializeSilentRequest } from '../request/RequestHelpers.mjs';\nimport { generatePkceCodes } from '../crypto/PkceGenerator.mjs';\nimport { spaCodeAndNativeAccountIdPresent, unableToAcquireTokenFromNativePlatform, authCodeOrNativeAccountIdRequired, nativeConnectionNotEstablished, noAccountError } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction getAccountType(account) {\r\n const idTokenClaims = account?.idTokenClaims;\r\n if (idTokenClaims?.tfp || idTokenClaims?.acr) {\r\n return \"B2C\";\r\n }\r\n if (!idTokenClaims?.tid) {\r\n return undefined;\r\n }\r\n else if (idTokenClaims?.tid === \"9188040d-6c67-4c5b-b112-36a304b66dad\") {\r\n return \"MSA\";\r\n }\r\n return \"AAD\";\r\n}\r\nfunction preflightCheck(initialized, performanceEvent) {\r\n try {\r\n preflightCheck$1(initialized);\r\n }\r\n catch (e) {\r\n performanceEvent.end({ success: false }, e);\r\n throw e;\r\n }\r\n}\r\nclass StandardController {\r\n /**\r\n * @constructor\r\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\r\n * - authority: the authority URL for your application.\r\n * - redirect_uri: the uri of your application registered in the portal.\r\n *\r\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\r\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\r\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\r\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\r\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\r\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\r\n *\r\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\r\n * Full B2C functionality will be available in this library in future versions.\r\n *\r\n * @param configuration Object for the MSAL PublicClientApplication instance\r\n */\r\n constructor(operatingContext) {\r\n this.operatingContext = operatingContext;\r\n this.isBrowserEnvironment =\r\n this.operatingContext.isBrowserEnvironment();\r\n // Set the configuration.\r\n this.config = operatingContext.getConfig();\r\n this.initialized = false;\r\n // Initialize logger\r\n this.logger = this.operatingContext.getLogger();\r\n // Initialize the network module class.\r\n this.networkClient = this.config.system.networkClient;\r\n // Initialize the navigation client class.\r\n this.navigationClient = this.config.system.navigationClient;\r\n // Initialize redirectResponse Map\r\n this.redirectResponse = new Map();\r\n // Initial hybrid spa map\r\n this.hybridAuthCodeResponses = new Map();\r\n // Initialize performance client\r\n this.performanceClient = this.config.telemetry.client;\r\n // Initialize the crypto class.\r\n this.browserCrypto = this.isBrowserEnvironment\r\n ? new CryptoOps(this.logger, this.performanceClient)\r\n : DEFAULT_CRYPTO_IMPLEMENTATION;\r\n this.eventHandler = new EventHandler(this.logger);\r\n // Initialize the browser storage class.\r\n this.browserStorage = this.isBrowserEnvironment\r\n ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))\r\n : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);\r\n // initialize in memory storage for native flows\r\n const nativeCacheOptions = {\r\n cacheLocation: BrowserCacheLocation.MemoryStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n cacheMigrationEnabled: false,\r\n claimsBasedCachingEnabled: false,\r\n };\r\n this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler);\r\n // Initialize the token cache\r\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\r\n this.activeSilentTokenRequests = new Map();\r\n // Register listener functions\r\n this.trackPageVisibility = this.trackPageVisibility.bind(this);\r\n // Register listener functions\r\n this.trackPageVisibilityWithMeasurement =\r\n this.trackPageVisibilityWithMeasurement.bind(this);\r\n }\r\n static async createController(operatingContext, request) {\r\n const controller = new StandardController(operatingContext);\r\n await controller.initialize(request);\r\n return controller;\r\n }\r\n trackPageVisibility(correlationId) {\r\n if (!correlationId) {\r\n return;\r\n }\r\n this.logger.info(\"Perf: Visibility change detected\");\r\n this.performanceClient.incrementFields({ visibilityChangeCount: 1 }, correlationId);\r\n }\r\n /**\r\n * Initializer function to perform async startup tasks such as connecting to WAM extension\r\n * @param request {?InitializeApplicationRequest} correlation id\r\n */\r\n async initialize(request) {\r\n this.logger.trace(\"initialize called\");\r\n if (this.initialized) {\r\n this.logger.info(\"initialize has already been called, exiting early.\");\r\n return;\r\n }\r\n if (!this.isBrowserEnvironment) {\r\n this.logger.info(\"in non-browser environment, exiting early.\");\r\n this.initialized = true;\r\n this.eventHandler.emitEvent(EventType.INITIALIZE_END);\r\n return;\r\n }\r\n const initCorrelationId = request?.correlationId || this.getRequestCorrelationId();\r\n const allowPlatformBroker = this.config.system.allowPlatformBroker;\r\n const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication, initCorrelationId);\r\n this.eventHandler.emitEvent(EventType.INITIALIZE_START);\r\n await invokeAsync(this.browserStorage.initialize.bind(this.browserStorage), PerformanceEvents.InitializeCache, this.logger, this.performanceClient, initCorrelationId)(initCorrelationId);\r\n if (allowPlatformBroker) {\r\n try {\r\n this.nativeExtensionProvider =\r\n await NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient);\r\n }\r\n catch (e) {\r\n this.logger.verbose(e);\r\n }\r\n }\r\n if (!this.config.cache.claimsBasedCachingEnabled) {\r\n this.logger.verbose(\"Claims-based caching is disabled. Clearing the previous cache with claims\");\r\n await invokeAsync(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage), PerformanceEvents.ClearTokensAndKeysWithClaims, this.logger, this.performanceClient, initCorrelationId)(this.performanceClient, initCorrelationId);\r\n }\r\n this.config.system.asyncPopups &&\r\n (await this.preGeneratePkceCodes(initCorrelationId));\r\n this.initialized = true;\r\n this.eventHandler.emitEvent(EventType.INITIALIZE_END);\r\n initMeasurement.end({\r\n allowPlatformBroker: allowPlatformBroker,\r\n success: true,\r\n });\r\n }\r\n // #region Redirect Flow\r\n /**\r\n * Event handler function which allows users to fire events after the PublicClientApplication object\r\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\r\n * auth flows.\r\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\r\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\r\n */\r\n async handleRedirectPromise(hash) {\r\n this.logger.verbose(\"handleRedirectPromise called\");\r\n // Block token acquisition before initialize has been called\r\n blockAPICallsBeforeInitialize(this.initialized);\r\n if (this.isBrowserEnvironment) {\r\n /**\r\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\r\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\r\n * several times concurrently.\r\n */\r\n const redirectResponseKey = hash || \"\";\r\n let response = this.redirectResponse.get(redirectResponseKey);\r\n if (typeof response === \"undefined\") {\r\n response = this.handleRedirectPromiseInternal(hash);\r\n this.redirectResponse.set(redirectResponseKey, response);\r\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\r\n }\r\n else {\r\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\r\n }\r\n return response;\r\n }\r\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\r\n return null;\r\n }\r\n /**\r\n * The internal details of handleRedirectPromise. This is separated out to a helper to allow handleRedirectPromise to memoize requests\r\n * @param hash\r\n * @returns\r\n */\r\n async handleRedirectPromiseInternal(hash) {\r\n const loggedInAccounts = this.getAllAccounts();\r\n const request = this.browserStorage.getCachedNativeRequest();\r\n const useNative = request &&\r\n NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider) &&\r\n this.nativeExtensionProvider &&\r\n !hash;\r\n const correlationId = useNative\r\n ? request?.correlationId\r\n : this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || \"\";\r\n const rootMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenRedirect, correlationId);\r\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\r\n let redirectResponse;\r\n if (useNative && this.nativeExtensionProvider) {\r\n this.logger.trace(\"handleRedirectPromise - acquiring token from native platform\");\r\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);\r\n redirectResponse = invokeAsync(nativeClient.handleRedirectPromise.bind(nativeClient), PerformanceEvents.HandleNativeRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(this.performanceClient, rootMeasurement.event.correlationId);\r\n }\r\n else {\r\n this.logger.trace(\"handleRedirectPromise - acquiring token from web flow\");\r\n const redirectClient = this.createRedirectClient(correlationId);\r\n redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, rootMeasurement);\r\n }\r\n return redirectResponse\r\n .then((result) => {\r\n if (result) {\r\n // Emit login event if number of accounts change\r\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\r\n if (isLoggingIn) {\r\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\r\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\r\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\r\n }\r\n rootMeasurement.end({\r\n success: true,\r\n accountType: getAccountType(result.account),\r\n });\r\n }\r\n else {\r\n /*\r\n * Instrument an event only if an error code is set. Otherwise, discard it when the redirect response\r\n * is empty and the error code is missing.\r\n */\r\n if (rootMeasurement.event.errorCode) {\r\n rootMeasurement.end({ success: false });\r\n }\r\n else {\r\n rootMeasurement.discard();\r\n }\r\n }\r\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\r\n return result;\r\n })\r\n .catch((e) => {\r\n const eventError = e;\r\n // Emit login event if there is an account\r\n if (loggedInAccounts.length > 0) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, eventError);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, eventError);\r\n }\r\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\r\n rootMeasurement.end({\r\n success: false,\r\n }, eventError);\r\n throw e;\r\n });\r\n }\r\n /**\r\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\r\n * the page, so any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n async acquireTokenRedirect(request) {\r\n // Preflight request\r\n const correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"acquireTokenRedirect called\", correlationId);\r\n const atrMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPreRedirect, correlationId);\r\n atrMeasurement.add({\r\n accountType: getAccountType(request.account),\r\n scenarioId: request.scenarioId,\r\n });\r\n // Override on request only if set, as onRedirectNavigate field is deprecated\r\n const onRedirectNavigateCb = request.onRedirectNavigate;\r\n if (onRedirectNavigateCb) {\r\n request.onRedirectNavigate = (url) => {\r\n const navigate = typeof onRedirectNavigateCb === \"function\"\r\n ? onRedirectNavigateCb(url)\r\n : undefined;\r\n if (navigate !== false) {\r\n atrMeasurement.end({ success: true });\r\n }\r\n else {\r\n atrMeasurement.discard();\r\n }\r\n return navigate;\r\n };\r\n }\r\n else {\r\n const configOnRedirectNavigateCb = this.config.auth.onRedirectNavigate;\r\n this.config.auth.onRedirectNavigate = (url) => {\r\n const navigate = typeof configOnRedirectNavigateCb === \"function\"\r\n ? configOnRedirectNavigateCb(url)\r\n : undefined;\r\n if (navigate !== false) {\r\n atrMeasurement.end({ success: true });\r\n }\r\n else {\r\n atrMeasurement.discard();\r\n }\r\n return navigate;\r\n };\r\n }\r\n // If logged in, emit acquire token events\r\n const isLoggedIn = this.getAllAccounts().length > 0;\r\n try {\r\n redirectPreflightCheck(this.initialized, this.config);\r\n this.browserStorage.setInteractionInProgress(true);\r\n if (isLoggedIn) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\r\n }\r\n let result;\r\n if (this.nativeExtensionProvider &&\r\n this.canUsePlatformBroker(request)) {\r\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);\r\n result = nativeClient\r\n .acquireTokenRedirect(request, atrMeasurement)\r\n .catch((e) => {\r\n if (e instanceof NativeAuthError &&\r\n isFatalNativeAuthError(e)) {\r\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n const redirectClient = this.createRedirectClient(correlationId);\r\n return redirectClient.acquireToken(request);\r\n }\r\n else if (e instanceof InteractionRequiredAuthError) {\r\n this.logger.verbose(\"acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow\");\r\n const redirectClient = this.createRedirectClient(correlationId);\r\n return redirectClient.acquireToken(request);\r\n }\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw e;\r\n });\r\n }\r\n else {\r\n const redirectClient = this.createRedirectClient(correlationId);\r\n result = redirectClient.acquireToken(request);\r\n }\r\n return await result;\r\n }\r\n catch (e) {\r\n atrMeasurement.end({ success: false }, e);\r\n if (isLoggedIn) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n throw e;\r\n }\r\n }\r\n // #endregion\r\n // #region Popup Flow\r\n /**\r\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n acquireTokenPopup(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);\r\n atPopupMeasurement.add({\r\n scenarioId: request.scenarioId,\r\n accountType: getAccountType(request.account),\r\n });\r\n try {\r\n this.logger.verbose(\"acquireTokenPopup called\", correlationId);\r\n preflightCheck(this.initialized, atPopupMeasurement);\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n catch (e) {\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n // If logged in, emit acquire token events\r\n const loggedInAccounts = this.getAllAccounts();\r\n if (loggedInAccounts.length > 0) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\r\n }\r\n let result;\r\n const pkce = this.getPreGeneratedPkceCodes(correlationId);\r\n if (this.canUsePlatformBroker(request)) {\r\n result = this.acquireTokenNative({\r\n ...request,\r\n correlationId,\r\n }, ApiId.acquireTokenPopup)\r\n .then((response) => {\r\n this.browserStorage.setInteractionInProgress(false);\r\n atPopupMeasurement.end({\r\n success: true,\r\n isNativeBroker: true,\r\n accountType: getAccountType(response.account),\r\n });\r\n return response;\r\n })\r\n .catch((e) => {\r\n if (e instanceof NativeAuthError &&\r\n isFatalNativeAuthError(e)) {\r\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n const popupClient = this.createPopupClient(correlationId);\r\n return popupClient.acquireToken(request, pkce);\r\n }\r\n else if (e instanceof InteractionRequiredAuthError) {\r\n this.logger.verbose(\"acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow\");\r\n const popupClient = this.createPopupClient(correlationId);\r\n return popupClient.acquireToken(request, pkce);\r\n }\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw e;\r\n });\r\n }\r\n else {\r\n const popupClient = this.createPopupClient(correlationId);\r\n result = popupClient.acquireToken(request, pkce);\r\n }\r\n return result\r\n .then((result) => {\r\n /*\r\n * If logged in, emit acquire token events\r\n */\r\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\r\n if (isLoggingIn) {\r\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\r\n }\r\n atPopupMeasurement.end({\r\n success: true,\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length,\r\n accountType: getAccountType(result.account),\r\n });\r\n return result;\r\n })\r\n .catch((e) => {\r\n if (loggedInAccounts.length > 0) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\r\n }\r\n atPopupMeasurement.end({\r\n success: false,\r\n }, e);\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n })\r\n .finally(() => this.config.system.asyncPopups &&\r\n this.preGeneratePkceCodes(correlationId));\r\n }\r\n trackPageVisibilityWithMeasurement() {\r\n const measurement = this.ssoSilentMeasurement ||\r\n this.acquireTokenByCodeAsyncMeasurement;\r\n if (!measurement) {\r\n return;\r\n }\r\n this.logger.info(\"Perf: Visibility change detected in \", measurement.event.name);\r\n measurement.increment({\r\n visibilityChangeCount: 1,\r\n });\r\n }\r\n // #endregion\r\n // #region Silent Flow\r\n /**\r\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\r\n * - Any browser using a form of Intelligent Tracking Prevention\r\n * - If there is not an established session with the service\r\n *\r\n * In these cases, the request must be done inside a popup or full frame redirect.\r\n *\r\n * For the cases where interaction is required, you cannot send a request with prompt=none.\r\n *\r\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\r\n * you session on the server still exists.\r\n * @param request {@link SsoSilentRequest}\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n async ssoSilent(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n const validRequest = {\r\n ...request,\r\n // will be PromptValue.NONE or PromptValue.NO_SESSION\r\n prompt: request.prompt,\r\n correlationId: correlationId,\r\n };\r\n this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);\r\n this.ssoSilentMeasurement?.add({\r\n scenarioId: request.scenarioId,\r\n accountType: getAccountType(request.account),\r\n });\r\n preflightCheck(this.initialized, this.ssoSilentMeasurement);\r\n this.ssoSilentMeasurement?.increment({\r\n visibilityChangeCount: 0,\r\n });\r\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n this.logger.verbose(\"ssoSilent called\", correlationId);\r\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, validRequest);\r\n let result;\r\n if (this.canUsePlatformBroker(validRequest)) {\r\n result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {\r\n // If native token acquisition fails for availability reasons fallback to standard flow\r\n if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {\r\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\r\n return silentIframeClient.acquireToken(validRequest);\r\n }\r\n throw e;\r\n });\r\n }\r\n else {\r\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\r\n result = silentIframeClient.acquireToken(validRequest);\r\n }\r\n return result\r\n .then((response) => {\r\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);\r\n this.ssoSilentMeasurement?.end({\r\n success: true,\r\n isNativeBroker: response.fromNativeBroker,\r\n accessTokenSize: response.accessToken.length,\r\n idTokenSize: response.idToken.length,\r\n accountType: getAccountType(response.account),\r\n });\r\n return response;\r\n })\r\n .catch((e) => {\r\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\r\n this.ssoSilentMeasurement?.end({\r\n success: false,\r\n }, e);\r\n throw e;\r\n })\r\n .finally(() => {\r\n document.removeEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n });\r\n }\r\n /**\r\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\r\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\r\n * This API is not indended for normal authorization code acquisition and redemption.\r\n *\r\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\r\n *\r\n * @param request {@link AuthorizationCodeRequest}\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n async acquireTokenByCode(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n this.logger.trace(\"acquireTokenByCode called\", correlationId);\r\n const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, correlationId);\r\n preflightCheck(this.initialized, atbcMeasurement);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\r\n atbcMeasurement.add({ scenarioId: request.scenarioId });\r\n try {\r\n if (request.code && request.nativeAccountId) {\r\n // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.\r\n throw createBrowserAuthError(spaCodeAndNativeAccountIdPresent);\r\n }\r\n else if (request.code) {\r\n const hybridAuthCode = request.code;\r\n let response = this.hybridAuthCodeResponses.get(hybridAuthCode);\r\n if (!response) {\r\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", correlationId);\r\n response = this.acquireTokenByCodeAsync({\r\n ...request,\r\n correlationId,\r\n })\r\n .then((result) => {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\r\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\r\n atbcMeasurement.end({\r\n success: true,\r\n isNativeBroker: result.fromNativeBroker,\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length,\r\n accountType: getAccountType(result.account),\r\n });\r\n return result;\r\n })\r\n .catch((error) => {\r\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, error);\r\n atbcMeasurement.end({\r\n success: false,\r\n }, error);\r\n throw error;\r\n });\r\n this.hybridAuthCodeResponses.set(hybridAuthCode, response);\r\n }\r\n else {\r\n this.logger.verbose(\"Existing acquireTokenByCode request found\", correlationId);\r\n atbcMeasurement.discard();\r\n }\r\n return await response;\r\n }\r\n else if (request.nativeAccountId) {\r\n if (this.canUsePlatformBroker(request, request.nativeAccountId)) {\r\n const result = await this.acquireTokenNative({\r\n ...request,\r\n correlationId,\r\n }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {\r\n // If native token acquisition fails for availability reasons fallback to standard flow\r\n if (e instanceof NativeAuthError &&\r\n isFatalNativeAuthError(e)) {\r\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n }\r\n throw e;\r\n });\r\n atbcMeasurement.end({\r\n accountType: getAccountType(result.account),\r\n success: true,\r\n });\r\n return result;\r\n }\r\n else {\r\n throw createBrowserAuthError(unableToAcquireTokenFromNativePlatform);\r\n }\r\n }\r\n else {\r\n throw createBrowserAuthError(authCodeOrNativeAccountIdRequired);\r\n }\r\n }\r\n catch (e) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\r\n atbcMeasurement.end({\r\n success: false,\r\n }, e);\r\n throw e;\r\n }\r\n }\r\n /**\r\n * Creates a SilentAuthCodeClient to redeem an authorization code.\r\n * @param request\r\n * @returns Result of the operation to redeem the authorization code\r\n */\r\n async acquireTokenByCodeAsync(request) {\r\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\r\n this.acquireTokenByCodeAsyncMeasurement =\r\n this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);\r\n this.acquireTokenByCodeAsyncMeasurement?.increment({\r\n visibilityChangeCount: 0,\r\n });\r\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n const silentAuthCodeClient = this.createSilentAuthCodeClient(request.correlationId);\r\n const silentTokenResult = await silentAuthCodeClient\r\n .acquireToken(request)\r\n .then((response) => {\r\n this.acquireTokenByCodeAsyncMeasurement?.end({\r\n success: true,\r\n fromCache: response.fromCache,\r\n isNativeBroker: response.fromNativeBroker,\r\n });\r\n return response;\r\n })\r\n .catch((tokenRenewalError) => {\r\n this.acquireTokenByCodeAsyncMeasurement?.end({\r\n success: false,\r\n }, tokenRenewalError);\r\n throw tokenRenewalError;\r\n })\r\n .finally(() => {\r\n document.removeEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n });\r\n return silentTokenResult;\r\n }\r\n /**\r\n * Attempt to acquire an access token from the cache\r\n * @param silentCacheClient SilentCacheClient\r\n * @param commonRequest CommonSilentFlowRequest\r\n * @param silentRequest SilentRequest\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n async acquireTokenFromCache(commonRequest, cacheLookupPolicy) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);\r\n switch (cacheLookupPolicy) {\r\n case CacheLookupPolicy.Default:\r\n case CacheLookupPolicy.AccessToken:\r\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\r\n const silentCacheClient = this.createSilentCacheClient(commonRequest.correlationId);\r\n return invokeAsync(silentCacheClient.acquireToken.bind(silentCacheClient), PerformanceEvents.SilentCacheClientAcquireToken, this.logger, this.performanceClient, commonRequest.correlationId)(commonRequest);\r\n default:\r\n throw createClientAuthError(ClientAuthErrorCodes.tokenRefreshRequired);\r\n }\r\n }\r\n /**\r\n * Attempt to acquire an access token via a refresh token\r\n * @param commonRequest CommonSilentFlowRequest\r\n * @param cacheLookupPolicy CacheLookupPolicy\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n async acquireTokenByRefreshToken(commonRequest, cacheLookupPolicy) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);\r\n switch (cacheLookupPolicy) {\r\n case CacheLookupPolicy.Default:\r\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\r\n case CacheLookupPolicy.RefreshToken:\r\n case CacheLookupPolicy.RefreshTokenAndNetwork:\r\n const silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);\r\n return invokeAsync(silentRefreshClient.acquireToken.bind(silentRefreshClient), PerformanceEvents.SilentRefreshClientAcquireToken, this.logger, this.performanceClient, commonRequest.correlationId)(commonRequest);\r\n default:\r\n throw createClientAuthError(ClientAuthErrorCodes.tokenRefreshRequired);\r\n }\r\n }\r\n /**\r\n * Attempt to acquire an access token via an iframe\r\n * @param request CommonSilentFlowRequest\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n async acquireTokenBySilentIframe(request) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);\r\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\r\n return invokeAsync(silentIframeClient.acquireToken.bind(silentIframeClient), PerformanceEvents.SilentIframeClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(request);\r\n }\r\n // #endregion\r\n // #region Logout\r\n /**\r\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\r\n * @param logoutRequest\r\n * @deprecated\r\n */\r\n async logout(logoutRequest) {\r\n const correlationId = this.getRequestCorrelationId(logoutRequest);\r\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\", correlationId);\r\n return this.logoutRedirect({\r\n correlationId,\r\n ...logoutRequest,\r\n });\r\n }\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n async logoutRedirect(logoutRequest) {\r\n const correlationId = this.getRequestCorrelationId(logoutRequest);\r\n redirectPreflightCheck(this.initialized, this.config);\r\n this.browserStorage.setInteractionInProgress(true);\r\n const redirectClient = this.createRedirectClient(correlationId);\r\n return redirectClient.logout(logoutRequest);\r\n }\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n logoutPopup(logoutRequest) {\r\n try {\r\n const correlationId = this.getRequestCorrelationId(logoutRequest);\r\n preflightCheck$1(this.initialized);\r\n this.browserStorage.setInteractionInProgress(true);\r\n const popupClient = this.createPopupClient(correlationId);\r\n return popupClient.logout(logoutRequest);\r\n }\r\n catch (e) {\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n }\r\n /**\r\n * Creates a cache interaction client to clear broswer cache.\r\n * @param logoutRequest\r\n */\r\n async clearCache(logoutRequest) {\r\n if (!this.isBrowserEnvironment) {\r\n this.logger.info(\"in non-browser environment, returning early.\");\r\n return;\r\n }\r\n const correlationId = this.getRequestCorrelationId(logoutRequest);\r\n const cacheClient = this.createSilentCacheClient(correlationId);\r\n return cacheClient.logout(logoutRequest);\r\n }\r\n // #endregion\r\n // #region Account APIs\r\n /**\r\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\r\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\r\n * @returns Array of AccountInfo objects in cache\r\n */\r\n getAllAccounts(accountFilter) {\r\n return getAllAccounts(this.logger, this.browserStorage, this.isBrowserEnvironment, accountFilter);\r\n }\r\n /**\r\n * Returns the first account found in the cache that matches the account filter passed in.\r\n * @param accountFilter\r\n * @returns The first account found in the cache matching the provided filter or null if no account could be found.\r\n */\r\n getAccount(accountFilter) {\r\n return getAccount(accountFilter, this.logger, this.browserStorage);\r\n }\r\n /**\r\n * Returns the signed in account matching username.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found.\r\n * This API is provided for convenience but getAccountById should be used for best reliability\r\n * @param username\r\n * @returns The account object stored in MSAL\r\n */\r\n getAccountByUsername(username) {\r\n return getAccountByUsername(username, this.logger, this.browserStorage);\r\n }\r\n /**\r\n * Returns the signed in account matching homeAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param homeAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\n getAccountByHomeId(homeAccountId) {\r\n return getAccountByHomeId(homeAccountId, this.logger, this.browserStorage);\r\n }\r\n /**\r\n * Returns the signed in account matching localAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param localAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\n getAccountByLocalId(localAccountId) {\r\n return getAccountByLocalId(localAccountId, this.logger, this.browserStorage);\r\n }\r\n /**\r\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\r\n * @param account\r\n */\r\n setActiveAccount(account) {\r\n setActiveAccount(account, this.browserStorage);\r\n }\r\n /**\r\n * Gets the currently active account\r\n */\r\n getActiveAccount() {\r\n return getActiveAccount(this.browserStorage);\r\n }\r\n // #endregion\r\n /**\r\n * Hydrates the cache with the tokens from an AuthenticationResult\r\n * @param result\r\n * @param request\r\n * @returns\r\n */\r\n async hydrateCache(result, request) {\r\n this.logger.verbose(\"hydrateCache called\");\r\n // Account gets saved to browser storage regardless of native or not\r\n const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);\r\n await this.browserStorage.setAccount(accountEntity, result.correlationId);\r\n if (result.fromNativeBroker) {\r\n this.logger.verbose(\"Response was from native broker, storing in-memory\");\r\n // Tokens from native broker are stored in-memory\r\n return this.nativeInternalStorage.hydrateCache(result, request);\r\n }\r\n else {\r\n return this.browserStorage.hydrateCache(result, request);\r\n }\r\n }\r\n // #region Helpers\r\n /**\r\n * Acquire a token from native device (e.g. WAM)\r\n * @param request\r\n */\r\n async acquireTokenNative(request, apiId, accountId, cacheLookupPolicy) {\r\n this.logger.trace(\"acquireTokenNative called\");\r\n if (!this.nativeExtensionProvider) {\r\n throw createBrowserAuthError(nativeConnectionNotEstablished);\r\n }\r\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);\r\n return nativeClient.acquireToken(request, cacheLookupPolicy);\r\n }\r\n /**\r\n * Returns boolean indicating if this request can use the platform broker\r\n * @param request\r\n */\r\n canUsePlatformBroker(request, accountId) {\r\n this.logger.trace(\"canUsePlatformBroker called\");\r\n if (!NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {\r\n this.logger.trace(\"canUsePlatformBroker: isPlatformBrokerAvailable returned false, returning false\");\r\n return false;\r\n }\r\n if (request.prompt) {\r\n switch (request.prompt) {\r\n case PromptValue.NONE:\r\n case PromptValue.CONSENT:\r\n case PromptValue.LOGIN:\r\n this.logger.trace(\"canUsePlatformBroker: prompt is compatible with platform broker flow\");\r\n break;\r\n default:\r\n this.logger.trace(`canUsePlatformBroker: prompt = ${request.prompt} is not compatible with platform broker flow, returning false`);\r\n return false;\r\n }\r\n }\r\n if (!accountId && !this.getNativeAccountId(request)) {\r\n this.logger.trace(\"canUsePlatformBroker: nativeAccountId is not available, returning false\");\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Get the native accountId from the account\r\n * @param request\r\n * @returns\r\n */\r\n getNativeAccountId(request) {\r\n const account = request.account ||\r\n this.getAccount({\r\n loginHint: request.loginHint,\r\n sid: request.sid,\r\n }) ||\r\n this.getActiveAccount();\r\n return (account && account.nativeAccountId) || \"\";\r\n }\r\n /**\r\n * Returns new instance of the Popup Interaction Client\r\n * @param correlationId\r\n */\r\n createPopupClient(correlationId) {\r\n return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Returns new instance of the Redirect Interaction Client\r\n * @param correlationId\r\n */\r\n createRedirectClient(correlationId) {\r\n return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Returns new instance of the Silent Iframe Interaction Client\r\n * @param correlationId\r\n */\r\n createSilentIframeClient(correlationId) {\r\n return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Returns new instance of the Silent Cache Interaction Client\r\n */\r\n createSilentCacheClient(correlationId) {\r\n return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Returns new instance of the Silent Refresh Interaction Client\r\n */\r\n createSilentRefreshClient(correlationId) {\r\n return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Returns new instance of the Silent AuthCode Interaction Client\r\n */\r\n createSilentAuthCodeClient(correlationId) {\r\n return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n }\r\n /**\r\n * Adds event callbacks to array\r\n * @param callback\r\n */\r\n addEventCallback(callback, eventTypes) {\r\n return this.eventHandler.addEventCallback(callback, eventTypes);\r\n }\r\n /**\r\n * Removes callback with provided id from callback array\r\n * @param callbackId\r\n */\r\n removeEventCallback(callbackId) {\r\n this.eventHandler.removeEventCallback(callbackId);\r\n }\r\n /**\r\n * Registers a callback to receive performance events.\r\n *\r\n * @param {PerformanceCallbackFunction} callback\r\n * @returns {string}\r\n */\r\n addPerformanceCallback(callback) {\r\n blockNonBrowserEnvironment();\r\n return this.performanceClient.addPerformanceCallback(callback);\r\n }\r\n /**\r\n * Removes a callback registered with addPerformanceCallback.\r\n *\r\n * @param {string} callbackId\r\n * @returns {boolean}\r\n */\r\n removePerformanceCallback(callbackId) {\r\n return this.performanceClient.removePerformanceCallback(callbackId);\r\n }\r\n /**\r\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n * @deprecated These events will be raised by default and this method will be removed in a future major version.\r\n */\r\n enableAccountStorageEvents() {\r\n if (this.config.cache.cacheLocation !==\r\n BrowserCacheLocation.LocalStorage) {\r\n this.logger.info(\"Account storage events are only available when cacheLocation is set to localStorage\");\r\n return;\r\n }\r\n this.eventHandler.subscribeCrossTab();\r\n }\r\n /**\r\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n * @deprecated These events will be raised by default and this method will be removed in a future major version.\r\n */\r\n disableAccountStorageEvents() {\r\n if (this.config.cache.cacheLocation !==\r\n BrowserCacheLocation.LocalStorage) {\r\n this.logger.info(\"Account storage events are only available when cacheLocation is set to localStorage\");\r\n return;\r\n }\r\n this.eventHandler.unsubscribeCrossTab();\r\n }\r\n /**\r\n * Gets the token cache for the application.\r\n */\r\n getTokenCache() {\r\n return this.tokenCache;\r\n }\r\n /**\r\n * Returns the logger instance\r\n */\r\n getLogger() {\r\n return this.logger;\r\n }\r\n /**\r\n * Replaces the default logger set in configurations with new Logger with new configurations\r\n * @param logger Logger instance\r\n */\r\n setLogger(logger) {\r\n this.logger = logger;\r\n }\r\n /**\r\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\r\n * @param sku\r\n * @param version\r\n */\r\n initializeWrapperLibrary(sku, version) {\r\n // Validate the SKU passed in is one we expect\r\n this.browserStorage.setWrapperMetadata(sku, version);\r\n }\r\n /**\r\n * Sets navigation client\r\n * @param navigationClient\r\n */\r\n setNavigationClient(navigationClient) {\r\n this.navigationClient = navigationClient;\r\n }\r\n /**\r\n * Returns the configuration object\r\n */\r\n getConfiguration() {\r\n return this.config;\r\n }\r\n /**\r\n * Returns the performance client\r\n */\r\n getPerformanceClient() {\r\n return this.performanceClient;\r\n }\r\n /**\r\n * Returns the browser env indicator\r\n */\r\n isBrowserEnv() {\r\n return this.isBrowserEnvironment;\r\n }\r\n /**\r\n * Generates a correlation id for a request if none is provided.\r\n *\r\n * @protected\r\n * @param {?Partial} [request]\r\n * @returns {string}\r\n */\r\n getRequestCorrelationId(request) {\r\n if (request?.correlationId) {\r\n return request.correlationId;\r\n }\r\n if (this.isBrowserEnvironment) {\r\n return createNewGuid();\r\n }\r\n /*\r\n * Included for fallback for non-browser environments,\r\n * and to ensure this method always returns a string.\r\n */\r\n return Constants.EMPTY_STRING;\r\n }\r\n // #endregion\r\n /**\r\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\r\n * any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n async loginRedirect(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"loginRedirect called\", correlationId);\r\n return this.acquireTokenRedirect({\r\n correlationId,\r\n ...(request || DEFAULT_REQUEST),\r\n });\r\n }\r\n /**\r\n * Use when initiating the login process via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n loginPopup(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"loginPopup called\", correlationId);\r\n return this.acquireTokenPopup({\r\n correlationId,\r\n ...(request || DEFAULT_REQUEST),\r\n });\r\n }\r\n /**\r\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\r\n *\r\n * @param {@link (SilentRequest:type)}\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\r\n */\r\n async acquireTokenSilent(request) {\r\n const correlationId = this.getRequestCorrelationId(request);\r\n const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);\r\n atsMeasurement.add({\r\n cacheLookupPolicy: request.cacheLookupPolicy,\r\n scenarioId: request.scenarioId,\r\n });\r\n preflightCheck(this.initialized, atsMeasurement);\r\n this.logger.verbose(\"acquireTokenSilent called\", correlationId);\r\n const account = request.account || this.getActiveAccount();\r\n if (!account) {\r\n throw createBrowserAuthError(noAccountError);\r\n }\r\n atsMeasurement.add({ accountType: getAccountType(account) });\r\n return this.acquireTokenSilentDeduped(request, account, correlationId)\r\n .then((result) => {\r\n atsMeasurement.end({\r\n success: true,\r\n fromCache: result.fromCache,\r\n isNativeBroker: result.fromNativeBroker,\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length,\r\n });\r\n return {\r\n ...result,\r\n state: request.state,\r\n correlationId: correlationId, // Ensures PWB scenarios can correctly match request to response\r\n };\r\n })\r\n .catch((error) => {\r\n if (error instanceof AuthError) {\r\n // Ensures PWB scenarios can correctly match request to response\r\n error.setCorrelationId(correlationId);\r\n }\r\n atsMeasurement.end({\r\n success: false,\r\n }, error);\r\n throw error;\r\n });\r\n }\r\n /**\r\n * Checks if identical request is already in flight and returns reference to the existing promise or fires off a new one if this is the first\r\n * @param request\r\n * @param account\r\n * @param correlationId\r\n * @returns\r\n */\r\n async acquireTokenSilentDeduped(request, account, correlationId) {\r\n const thumbprint = getRequestThumbprint(this.config.auth.clientId, {\r\n ...request,\r\n authority: request.authority || this.config.auth.authority,\r\n correlationId: correlationId,\r\n }, account.homeAccountId);\r\n const silentRequestKey = JSON.stringify(thumbprint);\r\n const inProgressRequest = this.activeSilentTokenRequests.get(silentRequestKey);\r\n if (typeof inProgressRequest === \"undefined\") {\r\n this.logger.verbose(\"acquireTokenSilent called for the first time, storing active request\", correlationId);\r\n this.performanceClient.addFields({ deduped: false }, correlationId);\r\n const activeRequest = invokeAsync(this.acquireTokenSilentAsync.bind(this), PerformanceEvents.AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)({\r\n ...request,\r\n correlationId,\r\n }, account);\r\n this.activeSilentTokenRequests.set(silentRequestKey, activeRequest);\r\n return activeRequest.finally(() => {\r\n this.activeSilentTokenRequests.delete(silentRequestKey);\r\n });\r\n }\r\n else {\r\n this.logger.verbose(\"acquireTokenSilent has been called previously, returning the result from the first call\", correlationId);\r\n this.performanceClient.addFields({ deduped: true }, correlationId);\r\n return inProgressRequest;\r\n }\r\n }\r\n /**\r\n * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.\r\n * @param {@link (SilentRequest:type)}\r\n * @param {@link (AccountInfo:type)}\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}\r\n */\r\n async acquireTokenSilentAsync(request, account) {\r\n const trackPageVisibility = () => this.trackPageVisibility(request.correlationId);\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\r\n if (request.correlationId) {\r\n this.performanceClient.incrementFields({ visibilityChangeCount: 0 }, request.correlationId);\r\n }\r\n document.addEventListener(\"visibilitychange\", trackPageVisibility);\r\n const silentRequest = await invokeAsync(initializeSilentRequest, PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account, this.config, this.performanceClient, this.logger);\r\n const cacheLookupPolicy = request.cacheLookupPolicy || CacheLookupPolicy.Default;\r\n const result = this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy).catch(async (refreshTokenError) => {\r\n const shouldTryToResolveSilently = checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, cacheLookupPolicy);\r\n if (shouldTryToResolveSilently) {\r\n if (!this.activeIframeRequest) {\r\n let _resolve;\r\n // Always set the active request tracker immediately after checking it to prevent races\r\n this.activeIframeRequest = [\r\n new Promise((resolve) => {\r\n _resolve = resolve;\r\n }),\r\n silentRequest.correlationId,\r\n ];\r\n this.logger.verbose(\"Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.\", silentRequest.correlationId);\r\n return invokeAsync(this.acquireTokenBySilentIframe.bind(this), PerformanceEvents.AcquireTokenBySilentIframe, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest)\r\n .then((iframeResult) => {\r\n _resolve(true);\r\n return iframeResult;\r\n })\r\n .catch((e) => {\r\n _resolve(false);\r\n throw e;\r\n })\r\n .finally(() => {\r\n this.activeIframeRequest = undefined;\r\n });\r\n }\r\n else if (cacheLookupPolicy !== CacheLookupPolicy.Skip) {\r\n const [activePromise, activeCorrelationId] = this.activeIframeRequest;\r\n this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${activeCorrelationId}`, silentRequest.correlationId);\r\n const awaitConcurrentIframeMeasure = this.performanceClient.startMeasurement(PerformanceEvents.AwaitConcurrentIframe, silentRequest.correlationId);\r\n awaitConcurrentIframeMeasure.add({\r\n awaitIframeCorrelationId: activeCorrelationId,\r\n });\r\n const activePromiseResult = await activePromise;\r\n awaitConcurrentIframeMeasure.end({\r\n success: activePromiseResult,\r\n });\r\n if (activePromiseResult) {\r\n this.logger.verbose(`Parallel iframe request with correlationId: ${activeCorrelationId} succeeded. Retrying cache and/or RT redemption`, silentRequest.correlationId);\r\n // Retry cache lookup and/or RT exchange after iframe completes\r\n return this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy);\r\n }\r\n else {\r\n this.logger.info(`Iframe request with correlationId: ${activeCorrelationId} failed. Interaction is required.`);\r\n // If previous iframe request failed, it's unlikely to succeed this time. Throw original error.\r\n throw refreshTokenError;\r\n }\r\n }\r\n else {\r\n // Cache policy set to skip and another iframe request is already in progress\r\n this.logger.warning(\"Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.\", silentRequest.correlationId);\r\n return invokeAsync(this.acquireTokenBySilentIframe.bind(this), PerformanceEvents.AcquireTokenBySilentIframe, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);\r\n }\r\n }\r\n else {\r\n // Error cannot be silently resolved or iframe renewal is not allowed, interaction required\r\n throw refreshTokenError;\r\n }\r\n });\r\n return result\r\n .then((response) => {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);\r\n if (request.correlationId) {\r\n this.performanceClient.addFields({\r\n fromCache: response.fromCache,\r\n isNativeBroker: response.fromNativeBroker,\r\n }, request.correlationId);\r\n }\r\n return response;\r\n })\r\n .catch((tokenRenewalError) => {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);\r\n throw tokenRenewalError;\r\n })\r\n .finally(() => {\r\n document.removeEventListener(\"visibilitychange\", trackPageVisibility);\r\n });\r\n }\r\n /**\r\n * AcquireTokenSilent without the iframe fallback. This is used to enable the correct fallbacks in cases where there's a potential for multiple silent requests to be made in parallel and prevent those requests from making concurrent iframe requests.\r\n * @param silentRequest\r\n * @param cacheLookupPolicy\r\n * @returns\r\n */\r\n async acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy) {\r\n // if the cache policy is set to access_token only, we should not be hitting the native layer yet\r\n if (NativeMessageHandler.isPlatformBrokerAvailable(this.config, this.logger, this.nativeExtensionProvider, silentRequest.authenticationScheme) &&\r\n silentRequest.account.nativeAccountId) {\r\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from native platform\");\r\n return this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow, silentRequest.account.nativeAccountId, cacheLookupPolicy).catch(async (e) => {\r\n // If native token acquisition fails for availability reasons fallback to web flow\r\n if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {\r\n this.logger.verbose(\"acquireTokenSilent - native platform unavailable, falling back to web flow\");\r\n this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt\r\n // Cache will not contain tokens, given that previous WAM requests succeeded. Skip cache and RT renewal and go straight to iframe renewal\r\n throw createClientAuthError(ClientAuthErrorCodes.tokenRefreshRequired);\r\n }\r\n throw e;\r\n });\r\n }\r\n else {\r\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from web flow\");\r\n // add logs to identify embedded cache retrieval\r\n if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {\r\n this.logger.verbose(\"acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache\");\r\n }\r\n return invokeAsync(this.acquireTokenFromCache.bind(this), PerformanceEvents.AcquireTokenFromCache, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest, cacheLookupPolicy).catch((cacheError) => {\r\n if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {\r\n throw cacheError;\r\n }\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, silentRequest);\r\n return invokeAsync(this.acquireTokenByRefreshToken.bind(this), PerformanceEvents.AcquireTokenByRefreshToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest, cacheLookupPolicy);\r\n });\r\n }\r\n }\r\n /**\r\n * Pre-generates PKCE codes and stores it in local variable\r\n * @param correlationId\r\n */\r\n async preGeneratePkceCodes(correlationId) {\r\n this.logger.verbose(\"Generating new PKCE codes\");\r\n this.pkceCode = await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Provides pre-generated PKCE codes, if any\r\n * @param correlationId\r\n */\r\n getPreGeneratedPkceCodes(correlationId) {\r\n this.logger.verbose(\"Attempting to pick up pre-generated PKCE codes\");\r\n const res = this.pkceCode ? { ...this.pkceCode } : undefined;\r\n this.pkceCode = undefined;\r\n this.logger.verbose(`${res ? \"Found\" : \"Did not find\"} pre-generated PKCE codes`);\r\n this.performanceClient.addFields({ usePreGeneratedPkce: !!res }, correlationId);\r\n return res;\r\n }\r\n}\r\n/**\r\n * Determines whether an error thrown by the refresh token endpoint can be resolved without interaction\r\n * @param refreshTokenError\r\n * @param silentRequest\r\n * @param cacheLookupPolicy\r\n * @returns\r\n */\r\nfunction checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, cacheLookupPolicy) {\r\n const noInteractionRequired = !(refreshTokenError instanceof InteractionRequiredAuthError &&\r\n // For refresh token errors, bad_token does not always require interaction (silently resolvable)\r\n refreshTokenError.subError !==\r\n InteractionRequiredAuthErrorCodes.badToken);\r\n // Errors that result when the refresh token needs to be replaced\r\n const refreshTokenRefreshRequired = refreshTokenError.errorCode === BrowserConstants.INVALID_GRANT_ERROR ||\r\n refreshTokenError.errorCode ===\r\n ClientAuthErrorCodes.tokenRefreshRequired;\r\n // Errors that may be resolved before falling back to interaction (through iframe renewal)\r\n const isSilentlyResolvable = (noInteractionRequired && refreshTokenRefreshRequired) ||\r\n refreshTokenError.errorCode ===\r\n InteractionRequiredAuthErrorCodes.noTokensFound ||\r\n refreshTokenError.errorCode ===\r\n InteractionRequiredAuthErrorCodes.refreshTokenExpired;\r\n // Only these policies allow for an iframe renewal attempt\r\n const tryIframeRenewal = iFrameRenewalPolicies.includes(cacheLookupPolicy);\r\n return isSilentlyResolvable && tryIframeRenewal;\r\n}\n\nexport { StandardController };\n//# sourceMappingURL=StandardController.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';\nimport { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';\nimport { StandardController } from './StandardController.mjs';\nimport { NestedAppAuthController } from './NestedAppAuthController.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nasync function createV3Controller(config, request) {\r\n const standard = new StandardOperatingContext(config);\r\n await standard.initialize();\r\n return StandardController.createController(standard, request);\r\n}\r\nasync function createController(config) {\r\n const standard = new StandardOperatingContext(config);\r\n const nestedApp = new NestedAppOperatingContext(config);\r\n const operatingContexts = [standard.initialize(), nestedApp.initialize()];\r\n await Promise.all(operatingContexts);\r\n if (nestedApp.isAvailable() && config.auth.supportsNestedAppAuth) {\r\n return NestedAppAuthController.createController(nestedApp);\r\n }\r\n else if (standard.isAvailable()) {\r\n return StandardController.createController(standard);\r\n }\r\n else {\r\n // Since neither of the actual operating contexts are available keep the UnknownOperatingContextController\r\n return null;\r\n }\r\n}\n\nexport { createController, createV3Controller };\n//# sourceMappingURL=ControllerFactory.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createV3Controller } from '../controllers/ControllerFactory.mjs';\nimport { StandardController } from '../controllers/StandardController.mjs';\nimport { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';\nimport { NestedAppAuthController } from '../controllers/NestedAppAuthController.mjs';\nimport { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications\r\n * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.\r\n */\r\nclass PublicClientApplication {\r\n /**\r\n * Creates StandardController and passes it to the PublicClientApplication\r\n *\r\n * @param configuration {Configuration}\r\n */\r\n static async createPublicClientApplication(configuration) {\r\n const controller = await createV3Controller(configuration);\r\n const pca = new PublicClientApplication(configuration, controller);\r\n return pca;\r\n }\r\n /**\r\n * @constructor\r\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\r\n * - authority: the authority URL for your application.\r\n * - redirect_uri: the uri of your application registered in the portal.\r\n *\r\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\r\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\r\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\r\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\r\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\r\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\r\n *\r\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\r\n * Full B2C functionality will be available in this library in future versions.\r\n *\r\n * @param configuration Object for the MSAL PublicClientApplication instance\r\n * @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)\r\n */\r\n constructor(configuration, controller) {\r\n this.controller =\r\n controller ||\r\n new StandardController(new StandardOperatingContext(configuration));\r\n }\r\n /**\r\n * Initializer function to perform async startup tasks such as connecting to WAM extension\r\n * @param request {?InitializeApplicationRequest}\r\n */\r\n async initialize(request) {\r\n return this.controller.initialize(request);\r\n }\r\n /**\r\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n async acquireTokenPopup(request) {\r\n return this.controller.acquireTokenPopup(request);\r\n }\r\n /**\r\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\r\n * the page, so any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n acquireTokenRedirect(request) {\r\n return this.controller.acquireTokenRedirect(request);\r\n }\r\n /**\r\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\r\n *\r\n * @param {@link (SilentRequest:type)}\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object\r\n */\r\n acquireTokenSilent(silentRequest) {\r\n return this.controller.acquireTokenSilent(silentRequest);\r\n }\r\n /**\r\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\r\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\r\n * This API is not indended for normal authorization code acquisition and redemption.\r\n *\r\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\r\n *\r\n * @param request {@link AuthorizationCodeRequest}\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n acquireTokenByCode(request) {\r\n return this.controller.acquireTokenByCode(request);\r\n }\r\n /**\r\n * Adds event callbacks to array\r\n * @param callback\r\n * @param eventTypes\r\n */\r\n addEventCallback(callback, eventTypes) {\r\n return this.controller.addEventCallback(callback, eventTypes);\r\n }\r\n /**\r\n * Removes callback with provided id from callback array\r\n * @param callbackId\r\n */\r\n removeEventCallback(callbackId) {\r\n return this.controller.removeEventCallback(callbackId);\r\n }\r\n /**\r\n * Registers a callback to receive performance events.\r\n *\r\n * @param {PerformanceCallbackFunction} callback\r\n * @returns {string}\r\n */\r\n addPerformanceCallback(callback) {\r\n return this.controller.addPerformanceCallback(callback);\r\n }\r\n /**\r\n * Removes a callback registered with addPerformanceCallback.\r\n *\r\n * @param {string} callbackId\r\n * @returns {boolean}\r\n */\r\n removePerformanceCallback(callbackId) {\r\n return this.controller.removePerformanceCallback(callbackId);\r\n }\r\n /**\r\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n enableAccountStorageEvents() {\r\n this.controller.enableAccountStorageEvents();\r\n }\r\n /**\r\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n disableAccountStorageEvents() {\r\n this.controller.disableAccountStorageEvents();\r\n }\r\n /**\r\n * Returns the first account found in the cache that matches the account filter passed in.\r\n * @param accountFilter\r\n * @returns The first account found in the cache matching the provided filter or null if no account could be found.\r\n */\r\n getAccount(accountFilter) {\r\n return this.controller.getAccount(accountFilter);\r\n }\r\n /**\r\n * Returns the signed in account matching homeAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param homeAccountId\r\n * @returns The account object stored in MSAL\r\n * @deprecated - Use getAccount instead\r\n */\r\n getAccountByHomeId(homeAccountId) {\r\n return this.controller.getAccountByHomeId(homeAccountId);\r\n }\r\n /**\r\n * Returns the signed in account matching localAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param localAccountId\r\n * @returns The account object stored in MSAL\r\n * @deprecated - Use getAccount instead\r\n */\r\n getAccountByLocalId(localId) {\r\n return this.controller.getAccountByLocalId(localId);\r\n }\r\n /**\r\n * Returns the signed in account matching username.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found.\r\n * This API is provided for convenience but getAccountById should be used for best reliability\r\n * @param userName\r\n * @returns The account object stored in MSAL\r\n * @deprecated - Use getAccount instead\r\n */\r\n getAccountByUsername(userName) {\r\n return this.controller.getAccountByUsername(userName);\r\n }\r\n /**\r\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\r\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\r\n * @returns Array of AccountInfo objects in cache\r\n */\r\n getAllAccounts(accountFilter) {\r\n return this.controller.getAllAccounts(accountFilter);\r\n }\r\n /**\r\n * Event handler function which allows users to fire events after the PublicClientApplication object\r\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\r\n * auth flows.\r\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\r\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\r\n */\r\n handleRedirectPromise(hash) {\r\n return this.controller.handleRedirectPromise(hash);\r\n }\r\n /**\r\n * Use when initiating the login process via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n loginPopup(request) {\r\n return this.controller.loginPopup(request);\r\n }\r\n /**\r\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\r\n * any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n loginRedirect(request) {\r\n return this.controller.loginRedirect(request);\r\n }\r\n /**\r\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\r\n * @param logoutRequest\r\n * @deprecated\r\n */\r\n logout(logoutRequest) {\r\n return this.controller.logout(logoutRequest);\r\n }\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n logoutRedirect(logoutRequest) {\r\n return this.controller.logoutRedirect(logoutRequest);\r\n }\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n logoutPopup(logoutRequest) {\r\n return this.controller.logoutPopup(logoutRequest);\r\n }\r\n /**\r\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\r\n * - Any browser using a form of Intelligent Tracking Prevention\r\n * - If there is not an established session with the service\r\n *\r\n * In these cases, the request must be done inside a popup or full frame redirect.\r\n *\r\n * For the cases where interaction is required, you cannot send a request with prompt=none.\r\n *\r\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\r\n * you session on the server still exists.\r\n * @param request {@link SsoSilentRequest}\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n ssoSilent(request) {\r\n return this.controller.ssoSilent(request);\r\n }\r\n /**\r\n * Gets the token cache for the application.\r\n */\r\n getTokenCache() {\r\n return this.controller.getTokenCache();\r\n }\r\n /**\r\n * Returns the logger instance\r\n */\r\n getLogger() {\r\n return this.controller.getLogger();\r\n }\r\n /**\r\n * Replaces the default logger set in configurations with new Logger with new configurations\r\n * @param logger Logger instance\r\n */\r\n setLogger(logger) {\r\n this.controller.setLogger(logger);\r\n }\r\n /**\r\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\r\n * @param account\r\n */\r\n setActiveAccount(account) {\r\n this.controller.setActiveAccount(account);\r\n }\r\n /**\r\n * Gets the currently active account\r\n */\r\n getActiveAccount() {\r\n return this.controller.getActiveAccount();\r\n }\r\n /**\r\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\r\n * @param sku\r\n * @param version\r\n */\r\n initializeWrapperLibrary(sku, version) {\r\n return this.controller.initializeWrapperLibrary(sku, version);\r\n }\r\n /**\r\n * Sets navigation client\r\n * @param navigationClient\r\n */\r\n setNavigationClient(navigationClient) {\r\n this.controller.setNavigationClient(navigationClient);\r\n }\r\n /**\r\n * Returns the configuration object\r\n * @internal\r\n */\r\n getConfiguration() {\r\n return this.controller.getConfiguration();\r\n }\r\n /**\r\n * Hydrates cache with the tokens and account in the AuthenticationResult object\r\n * @param result\r\n * @param request - The request object that was used to obtain the AuthenticationResult\r\n * @returns\r\n */\r\n async hydrateCache(result, request) {\r\n return this.controller.hydrateCache(result, request);\r\n }\r\n /**\r\n * Clears tokens and account from the browser cache.\r\n * @param logoutRequest\r\n */\r\n clearCache(logoutRequest) {\r\n return this.controller.clearCache(logoutRequest);\r\n }\r\n}\r\n/**\r\n * creates NestedAppAuthController and passes it to the PublicClientApplication,\r\n * falls back to StandardController if NestedAppAuthController is not available\r\n *\r\n * @param configuration\r\n * @returns IPublicClientApplication\r\n *\r\n */\r\nasync function createNestablePublicClientApplication(configuration) {\r\n const nestedAppAuth = new NestedAppOperatingContext(configuration);\r\n await nestedAppAuth.initialize();\r\n if (nestedAppAuth.isAvailable()) {\r\n const controller = new NestedAppAuthController(nestedAppAuth);\r\n const nestablePCA = new PublicClientApplication(configuration, controller);\r\n await nestablePCA.initialize();\r\n return nestablePCA;\r\n }\r\n return createStandardPublicClientApplication(configuration);\r\n}\r\n/**\r\n * creates PublicClientApplication using StandardController\r\n *\r\n * @param configuration\r\n * @returns IPublicClientApplication\r\n *\r\n */\r\nasync function createStandardPublicClientApplication(configuration) {\r\n const pca = new PublicClientApplication(configuration);\r\n await pca.initialize();\r\n return pca;\r\n}\n\nexport { PublicClientApplication, createNestablePublicClientApplication, createStandardPublicClientApplication };\n//# sourceMappingURL=PublicClientApplication.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { stubbedPublicClientApplicationCalled } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst stubbedPublicClientApplication = {\r\n initialize: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n acquireTokenPopup: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n acquireTokenRedirect: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n acquireTokenSilent: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n acquireTokenByCode: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n getAllAccounts: () => {\r\n return [];\r\n },\r\n getAccount: () => {\r\n return null;\r\n },\r\n getAccountByHomeId: () => {\r\n return null;\r\n },\r\n getAccountByUsername: () => {\r\n return null;\r\n },\r\n getAccountByLocalId: () => {\r\n return null;\r\n },\r\n handleRedirectPromise: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n loginPopup: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n loginRedirect: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n logout: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n logoutRedirect: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n logoutPopup: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n ssoSilent: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n addEventCallback: () => {\r\n return null;\r\n },\r\n removeEventCallback: () => {\r\n return;\r\n },\r\n addPerformanceCallback: () => {\r\n return \"\";\r\n },\r\n removePerformanceCallback: () => {\r\n return false;\r\n },\r\n enableAccountStorageEvents: () => {\r\n return;\r\n },\r\n disableAccountStorageEvents: () => {\r\n return;\r\n },\r\n getTokenCache: () => {\r\n throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);\r\n },\r\n getLogger: () => {\r\n throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);\r\n },\r\n setLogger: () => {\r\n return;\r\n },\r\n setActiveAccount: () => {\r\n return;\r\n },\r\n getActiveAccount: () => {\r\n return null;\r\n },\r\n initializeWrapperLibrary: () => {\r\n return;\r\n },\r\n setNavigationClient: () => {\r\n return;\r\n },\r\n getConfiguration: () => {\r\n throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);\r\n },\r\n hydrateCache: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n clearCache: () => {\r\n return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));\r\n },\r\n};\n\nexport { stubbedPublicClientApplication };\n//# sourceMappingURL=IPublicClientApplication.mjs.map\n","/*! @azure/msal-browser v4.8.0 2025-03-20 */\n'use strict';\nimport { EventType } from './EventType.mjs';\nimport { InteractionType, InteractionStatus } from '../utils/BrowserConstants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass EventMessageUtils {\r\n /**\r\n * Gets interaction status from event message\r\n * @param message\r\n * @param currentStatus\r\n */\r\n static getInteractionStatusFromEvent(message, currentStatus) {\r\n switch (message.eventType) {\r\n case EventType.LOGIN_START:\r\n return InteractionStatus.Login;\r\n case EventType.SSO_SILENT_START:\r\n return InteractionStatus.SsoSilent;\r\n case EventType.ACQUIRE_TOKEN_START:\r\n if (message.interactionType === InteractionType.Redirect ||\r\n message.interactionType === InteractionType.Popup) {\r\n return InteractionStatus.AcquireToken;\r\n }\r\n break;\r\n case EventType.HANDLE_REDIRECT_START:\r\n return InteractionStatus.HandleRedirect;\r\n case EventType.LOGOUT_START:\r\n return InteractionStatus.Logout;\r\n case EventType.SSO_SILENT_SUCCESS:\r\n case EventType.SSO_SILENT_FAILURE:\r\n if (currentStatus &&\r\n currentStatus !== InteractionStatus.SsoSilent) {\r\n // Prevent this event from clearing any status other than ssoSilent\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.LOGOUT_END:\r\n if (currentStatus &&\r\n currentStatus !== InteractionStatus.Logout) {\r\n // Prevent this event from clearing any status other than logout\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.HANDLE_REDIRECT_END:\r\n if (currentStatus &&\r\n currentStatus !== InteractionStatus.HandleRedirect) {\r\n // Prevent this event from clearing any status other than handleRedirect\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.LOGIN_SUCCESS:\r\n case EventType.LOGIN_FAILURE:\r\n case EventType.ACQUIRE_TOKEN_SUCCESS:\r\n case EventType.ACQUIRE_TOKEN_FAILURE:\r\n case EventType.RESTORE_FROM_BFCACHE:\r\n if (message.interactionType === InteractionType.Redirect ||\r\n message.interactionType === InteractionType.Popup) {\r\n if (currentStatus &&\r\n currentStatus !== InteractionStatus.Login &&\r\n currentStatus !== InteractionStatus.AcquireToken) {\r\n // Prevent this event from clearing any status other than login or acquireToken\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n }\r\n break;\r\n }\r\n return null;\r\n }\r\n}\n\nexport { EventMessageUtils };\n//# sourceMappingURL=EventMessage.mjs.map\n","import { LogLevel } from \"@azure/msal-browser\";\r\nimport config from \"./configuration.json\";\r\n// Browser check variables\r\n// If you support IE, our recommendation is that you sign-in using Redirect APIs\r\n// If you as a developer are testing using Edge InPrivate mode, please add \"isEdge\" to the if check\r\nconst ua = window.navigator.userAgent;\r\nconst msie = ua.indexOf(\"MSIE \");\r\nconst msie11 = ua.indexOf(\"Trident/\");\r\nconst msedge = ua.indexOf(\"Edge/\");\r\nconst firefox = ua.indexOf(\"Firefox\");\r\nconst isIE = msie > 0 || msie11 > 0;\r\nconst isEdge = msedge > 0;\r\nconst isFirefox = firefox > 0; // Only needed if you need to support the redirect flow in Firefox incognito\r\n\r\nexport const msalConfig = {\r\n auth: {\r\n clientId: config.msalConfig.auth.clientId, //\"0adea01d-5b14-4da4-b127-9561741163a2\", \r\n authority: config.msalConfig.auth.authority, //\"https://login.microsoftonline.com/lsacaces3.org\",\r\n validateAuthority: config.msalConfig.auth.validateAuthority, //true,\r\n knownAuthorities: config.msalConfig.auth.knownAuthorities,\r\n redirectUri: config.msalConfig.auth.redirectUri, //\"http://localhost:3000\",\r\n postLogoutRedirectUri: config.msalConfig.auth.postLogoutRedirectUri, //\"http://localhost:3000\",\r\n navigateToLoginRequestUrl: config.msalConfig.auth.navigateToLoginRequestUrl //true\r\n },\r\n cache: {\r\n cacheLocation: config.msalConfig.cache.cacheLocation, //\"sessionStorage\", // This configures where your cache will be stored\r\n storeAuthStateInCookie: isIE || isEdge || isFirefox // Set this to \"true\" if you are having issues on IE11 or Edge\r\n },\r\n system: {\t\r\n loggerOptions: {\t\r\n loggerCallback: (level, message, containsPii) => {\t\r\n if (containsPii) {\t\t\r\n return;\t\t\r\n }\t\t\r\n // eslint-disable-next-line default-case\r\n switch (level) {\t\t\r\n case LogLevel.Error:\t\t\r\n console.error('msalInstance -> error', message);\t\t\r\n return;\t\t\r\n case LogLevel.Info:\t\t\r\n console.info('msalInstance -> info', message);\t\t\r\n return;\t\t\r\n case LogLevel.Verbose:\t\t\r\n console.debug('msalInstance -> debug', message);\t\t\r\n return;\t\t\r\n case LogLevel.Warning:\t\t\r\n console.warn('msalInstance -> warn', message);\t\t\r\n return;\t\t\r\n }\t\r\n }\t\r\n },\r\n logger: {\r\n level: LogLevel.Verbose,\r\n piiLoggingEnabled: false,\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Scopes you add here will be prompted for user consent during sign-in.\r\n * By default, MSAL.js will add OIDC scopes (openid, profile, email) to any login request.\r\n * For more information about OIDC scopes, visit: \r\n * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#openid-connect-scopes\r\n */\r\nexport const loginRequest = {\r\n scopes: config.msalConfig.scopes \r\n};\r\n\r\n/**\r\n * Add here the scopes to request when obtaining an access token for MS Graph API. For more information, see:\r\n * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/resources-and-scopes.md\r\n */\r\nexport const graphConfig = {\r\n graphMeEndpoint: \"https://graph.microsoft-ppe.com/v1.0/me\"\r\n};","import { PublicClientApplication, InteractionRequiredAuthError } from \"@azure/msal-browser\";\r\nimport { msalConfig, loginRequest} from './authConfig';\r\n\r\nclass AuthService {\r\n\r\n //msalInstance = new PublicClientApplication(msalConfig);\r\n\r\n\r\n getAccounts = (msalInstance) => {\r\n const accounts = msalInstance.getAllAccounts();\r\n if(accounts) return accounts;\r\n return null;\r\n }\r\n\r\n fetchAccessToken = async (msalInstance) => {\r\n console.log('AuthService -> fetchAccessToken -> msalInstance', msalInstance)\r\n const accounts = msalInstance.getAllAccounts();\r\n\r\n const accessTokenRequest = {\r\n scopes: loginRequest.scopes, // [\"api://LSAC.ACES.DEV/LSAC.ACES.ReadWrite\"] , \r\n account: accounts[0]\r\n };\r\n\r\n const authResult = await msalInstance.acquireTokenSilent(accessTokenRequest)\r\n .then(accessTokenResponse => {\r\n // console.log('AuthService -> fetchAccessToken -> acquireTokenSilent -> accessTokenResponse', accessTokenResponse)\r\n return accessTokenResponse\r\n })\r\n .catch(error => {\r\n console.error('AuthService -> fetchAccessToken -> acquireTokenSilent -> error', error)\r\n if (error instanceof InteractionRequiredAuthError) {\r\n return this.msalInstance.acquireTokenRedirect(accessTokenRequest);\r\n }\r\n }\r\n );\r\n\r\n // console.log('AuthService -> fetchAccessToken -> authResult', authResult);\r\n\r\n if (authResult?.accessToken){\r\n return authResult.accessToken;\r\n }else{\r\n //when it doubt have them login\r\n msalInstance.loginRedirect(loginRequest.scopes)\r\n }\r\n };\r\n\r\n getUser = (msalInstance) => {\r\n const accounts = msalInstance.getAllAccounts();\r\n if(accounts?.[0]) return accounts[0];\r\n return null;\r\n }\r\n\r\n async fetchUserIp () {\r\n // const resp = await fetch('https://jsonip.com');\r\n const resp = await fetch('http://ip-api.com/json', { method: \"GET\", mode: 'cors', headers: { 'Content-Type': 'application/json',}});\r\n const jsonResp = await resp.json();\r\n return jsonResp.query; \r\n }\r\n\r\n login = (msalInstance) => {\r\n //console.log(\"AuthService -> login -> called\");\r\n msalInstance.loginRedirect(loginRequest.scopes) \r\n }\r\n\r\n logout = (msalInstance) => { \r\n //console.log(\"AuthService -> logout -> called\");\r\n const accounts = msalInstance.getAllAccounts();\r\n const logoutRequest = {\r\n account: msalInstance.getAccountByHomeId(accounts[0].homeAccountId),\r\n postLogoutRedirectUri: msalConfig.auth.postLogoutRedirectUri,\r\n navigateToLoginRequestUrl: true\r\n }\r\n\r\n sessionStorage.removeItem(\"isLogonUpdatedApiCalled\");\r\n //todo- we could remove below two session items, Need to check with Ruslan first\r\n sessionStorage.removeItem(\"isConfirmationDisplayedOnce\");\r\n sessionStorage.removeItem(\"isLegalConfirmationDisplayedOnce\");\r\n \r\n\r\n msalInstance.logoutRedirect(logoutRequest);\r\n };\r\n\r\n}\r\n\r\nconst authService = new AuthService();\r\n\r\nexport default authService;","import axios from 'axios'\r\nimport configuration from './configuration.json';\r\nimport authService from './authService';\r\n\r\n/**\r\n * Create an Axios Client with defaults\r\n */\r\nlet apiURL = configuration.apigateway;\r\n\r\nexport const client = axios.create({\r\n baseURL: apiURL,\r\n rejectUnauthorized: false,\r\n crossDomain: true,\r\n headers: {\r\n 'Ocp-Apim-Subscription-Key': configuration.SubscriptionKey\r\n }\r\n});\r\n\r\n/** \r\n * ApiRequest Wrapper with default success/error actions\r\n */\r\nconst apirequest = (msalInstance, options) => {\r\n\r\n if (!options?.headers){ options.headers = {}; }\r\n\r\n //execute API from Unite UI environment\r\n if(options.uniteAccessToken){\r\n //If called ASO Preview from the Unite website -> use uniteAccessToken\r\n options.headers['Authorization'] = `bearer ${options.uniteAccessToken}`;\r\n \r\n return client(options)\r\n .then(response => {\r\n return response.data;\r\n })\r\n .catch(error => Promise.reject(error.response || error.message));\r\n }\r\n\r\n //execute API from ASO Candidate website\r\n if(!options.uniteAccessToken){\r\n return authService.fetchAccessToken(msalInstance)\r\n .then((accessToken) => {\r\n //console.log('apirequest -> accessToken', accessToken);\r\n options.headers['Authorization'] = `bearer ${accessToken}`;\r\n\r\n return client(options)\r\n .then(response => {\r\n return response.data;\r\n })\r\n .catch(error => Promise.reject(error.response || error.message));\r\n });\r\n }\r\n \r\n}\r\n\r\nexport const request = function (msalInstance, options) {\r\n return authService.fetchAccessToken(msalInstance)\r\n .then((accessToken) => {\r\n \r\n if (!options.headers)\r\n options.headers = {};\r\n\r\n options.headers['Authorization'] = `bearer ${accessToken}`;\r\n if (options.isLocal) {\r\n console.warn(\"*** DEBUG:\", options.baseURL + options.url);\r\n options.baseURL='http://localhost';\r\n }\r\n\r\n return client(options)\r\n .then(response => {\r\n return response.data;\r\n })\r\n .catch(error => Promise.reject(error.response || error.message));\r\n });\r\n}\r\n\r\nexport default apirequest;\r\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","\"use client\";\n\nimport * as React from 'react';\nimport { useContext, useMemo } from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DEFAULT_BREAKPOINTS = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\nexport const DEFAULT_MIN_BREAKPOINT = 'xs';\nconst ThemeContext = /*#__PURE__*/React.createContext({\n prefixes: {},\n breakpoints: DEFAULT_BREAKPOINTS,\n minBreakpoint: DEFAULT_MIN_BREAKPOINT\n});\nconst {\n Consumer,\n Provider\n} = ThemeContext;\nfunction ThemeProvider({\n prefixes = {},\n breakpoints = DEFAULT_BREAKPOINTS,\n minBreakpoint = DEFAULT_MIN_BREAKPOINT,\n dir,\n children\n}) {\n const contextValue = useMemo(() => ({\n prefixes: {\n ...prefixes\n },\n breakpoints,\n minBreakpoint,\n dir\n }), [prefixes, breakpoints, minBreakpoint, dir]);\n return /*#__PURE__*/_jsx(Provider, {\n value: contextValue,\n children: children\n });\n}\nexport function useBootstrapPrefix(prefix, defaultPrefix) {\n const {\n prefixes\n } = useContext(ThemeContext);\n return prefix || prefixes[defaultPrefix] || defaultPrefix;\n}\nexport function useBootstrapBreakpoints() {\n const {\n breakpoints\n } = useContext(ThemeContext);\n return breakpoints;\n}\nexport function useBootstrapMinBreakpoint() {\n const {\n minBreakpoint\n } = useContext(ThemeContext);\n return minBreakpoint;\n}\nexport function useIsRTL() {\n const {\n dir\n } = useContext(ThemeContext);\n return dir === 'rtl';\n}\nfunction createBootstrapComponent(Component, opts) {\n if (typeof opts === 'string') opts = {\n prefix: opts\n };\n const isClassy = Component.prototype && Component.prototype.isReactComponent;\n // If it's a functional component make sure we don't break it with a ref\n const {\n prefix,\n forwardRefAs = isClassy ? 'ref' : 'innerRef'\n } = opts;\n const Wrapped = /*#__PURE__*/React.forwardRef(({\n ...props\n }, ref) => {\n props[forwardRefAs] = ref;\n const bsPrefix = useBootstrapPrefix(props.bsPrefix, prefix);\n return /*#__PURE__*/_jsx(Component, {\n ...props,\n bsPrefix: bsPrefix\n });\n });\n Wrapped.displayName = `Bootstrap(${Component.displayName || Component.name})`;\n return Wrapped;\n}\nexport { createBootstrapComponent, Consumer as ThemeConsumer };\nexport default ThemeProvider;","\"use client\";\n\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst Container = /*#__PURE__*/React.forwardRef(({\n bsPrefix,\n fluid = false,\n // Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\n as: Component = 'div',\n className,\n ...props\n}, ref) => {\n const prefix = useBootstrapPrefix(bsPrefix, 'container');\n const suffix = typeof fluid === 'string' ? `-${fluid}` : '-fluid';\n return /*#__PURE__*/_jsx(Component, {\n ref: ref,\n ...props,\n className: classNames(className, fluid ? `${prefix}${suffix}` : prefix)\n });\n});\nContainer.displayName = 'Container';\nexport default Container;","\"use client\";\n\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst Row = /*#__PURE__*/React.forwardRef(({\n bsPrefix,\n className,\n // Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\n as: Component = 'div',\n ...props\n}, ref) => {\n const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'row');\n const breakpoints = useBootstrapBreakpoints();\n const minBreakpoint = useBootstrapMinBreakpoint();\n const sizePrefix = `${decoratedBsPrefix}-cols`;\n const classes = [];\n breakpoints.forEach(brkPoint => {\n const propValue = props[brkPoint];\n delete props[brkPoint];\n let cols;\n if (propValue != null && typeof propValue === 'object') {\n ({\n cols\n } = propValue);\n } else {\n cols = propValue;\n }\n const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';\n if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);\n });\n return /*#__PURE__*/_jsx(Component, {\n ref: ref,\n ...props,\n className: classNames(className, decoratedBsPrefix, ...classes)\n });\n});\nRow.displayName = 'Row';\nexport default Row;","\"use client\";\n\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function useCol({\n as,\n bsPrefix,\n className,\n ...props\n}) {\n bsPrefix = useBootstrapPrefix(bsPrefix, 'col');\n const breakpoints = useBootstrapBreakpoints();\n const minBreakpoint = useBootstrapMinBreakpoint();\n const spans = [];\n const classes = [];\n breakpoints.forEach(brkPoint => {\n const propValue = props[brkPoint];\n delete props[brkPoint];\n let span;\n let offset;\n let order;\n if (typeof propValue === 'object' && propValue != null) {\n ({\n span,\n offset,\n order\n } = propValue);\n } else {\n span = propValue;\n }\n const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';\n if (span) spans.push(span === true ? `${bsPrefix}${infix}` : `${bsPrefix}${infix}-${span}`);\n if (order != null) classes.push(`order${infix}-${order}`);\n if (offset != null) classes.push(`offset${infix}-${offset}`);\n });\n return [{\n ...props,\n className: classNames(className, ...spans, ...classes)\n }, {\n as,\n bsPrefix,\n spans\n }];\n}\nconst Col = /*#__PURE__*/React.forwardRef(\n// Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\n(props, ref) => {\n const [{\n className,\n ...colProps\n }, {\n as: Component = 'div',\n bsPrefix,\n spans\n }] = useCol(props);\n return /*#__PURE__*/_jsx(Component, {\n ...colProps,\n ref: ref,\n className: classNames(className, !spans.length && bsPrefix)\n });\n});\nCol.displayName = 'Col';\nexport default Col;","import * as React from 'react';\n/** @hidden */\nexport var ZIndexContext = React.createContext(0);\n/** @hidden */\nexport var useZIndexContext = function () { return React.useContext(ZIndexContext); };\nZIndexContext.displayName = 'KendoReactZIndexContext';\n","/**\n * @hidden\n */\nvar getDocument = function () { return typeof document !== 'undefined' ? document : {}; };\n/**\n * @hidden\n */\nvar BrowserSupportService = /** @class */ (function () {\n function BrowserSupportService() {\n this.scrollbar = 0;\n }\n Object.defineProperty(BrowserSupportService.prototype, \"scrollbarWidth\", {\n get: function () {\n var document = getDocument();\n if (!this.scrollbar && document && document.createElement) {\n var div = document.createElement('div');\n div.style.cssText = 'overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block';\n div.innerHTML = ' ';\n document.body.appendChild(div);\n this.scrollbar = div.offsetWidth - div.scrollWidth;\n document.body.removeChild(div);\n }\n return this.scrollbar;\n },\n enumerable: false,\n configurable: true\n });\n return BrowserSupportService;\n}());\nexport { BrowserSupportService };\n","/**\n * @hidden\n */\nexport var canUseDOM = Boolean(\n// from fbjs\ntypeof window !== 'undefined' &&\n window.document &&\n window.document.createElement);\n","/**\n * @hidden\n */\nexport var classNames = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var result = {};\n var addLeafKeys = function (arg) { return typeof arg === 'object' ? Object\n .keys(arg)\n .forEach(function (key) {\n result[key] = arg[key];\n }) : result[arg] = true; };\n ;\n var addKeys = function (list) { return list\n .filter(function (arg) { return arg !== true && !!arg; })\n .map(function (arg) {\n return Array.isArray(arg) ?\n addKeys(arg) :\n addLeafKeys(arg);\n }); };\n ;\n addKeys(args);\n return Object\n .keys(result)\n .map(function (key) { return (result[key] && key) || null; })\n .filter(function (el) { return el !== null; })\n .join(' ');\n};\n","/* eslint-disable radix */\n/**\n * @hidden\n */\nvar DISABLED_TABINDEX = -1;\n/**\n * @hidden\n */\nvar DEFAULT_TABINDEX = 0;\n/**\n * @hidden\n */\nexport var getTabIndex = function (tabIndex, disabled, useDefaultTabIndexWhenDisabled) {\n var parsedTabIndex = typeof tabIndex === 'string' ? parseInt(tabIndex, undefined) : tabIndex;\n if (parsedTabIndex === NaN) {\n return undefined;\n }\n return parsedTabIndex !== undefined\n ? parsedTabIndex\n : disabled ?\n (useDefaultTabIndexWhenDisabled ? undefined : DISABLED_TABINDEX)\n : DEFAULT_TABINDEX;\n};\n","/**\n * @hidden\n */\nexport var FIELD_REGEX = /\\[(?:(\\d+)|['\"](.*?)['\"])\\]|((?:(?!\\[.*?\\]|\\.).)+)/g;\n","import { FIELD_REGEX } from './constants';\n/**\n * @hidden\n */\nexport function fieldList(field) {\n var fields = [];\n field.replace(FIELD_REGEX, function (_match, index, indexAccessor, fieldName) {\n fields.push(index !== undefined ? index : (indexAccessor || fieldName));\n });\n return fields;\n}\n","import { fieldList } from './fieldList';\nvar getterCache = {};\ngetterCache.undefined = function () { return undefined; };\n/**\n * Can be used for getting value from object using field path. For example `users[index].name`.\n *\n * @example\n * ```jsx-no-run\n * const values = {users:[{lastName: 'Doe'}]};\n * const firstUserLastName = getter('user[0].lastName');\n *\n * console.log(firstUserLastName(values))\n *\n * // result: 'Doe'\n * ```\n */\nexport function getter(field) {\n if (getterCache[field]) {\n return getterCache[field];\n }\n var fields = fieldList(field);\n getterCache[field] = function (obj) {\n var result = obj;\n for (var idx = 0; idx < fields.length && result; idx++) {\n result = result[fields[idx]];\n }\n return result;\n };\n return getterCache[field];\n}\n","/* eslint-disable no-bitwise */\n/**\n * @hidden\n */\nexport var guid = function () {\n var id = '';\n var i;\n var random;\n for (i = 0; i < 32; i++) {\n random = Math.random() * 16 | 0;\n if (i === 8 || i === 12 || i === 16 || i === 20) {\n id += '-';\n }\n id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);\n }\n return id;\n};\n","/**\n * @hidden\n */\nexport var Keys = {\n backspace: 8,\n tab: 9,\n enter: 13,\n shift: 16,\n esc: 27,\n space: 32,\n pageUp: 33,\n pageDown: 34,\n end: 35,\n home: 36,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n delete: 46\n};\n","/**\n * @hidden\n */\nexport var noop = function () { };\n","import { BrowserSupportService } from './browser-support.service';\nimport { canUseDOM } from './canUseDOM';\n/**\n * @hidden\n */\nexport var getScrollbarWidth = function () {\n if (!canUseDOM || !document.body) {\n return false;\n }\n var scrollbarWidth = new BrowserSupportService().scrollbarWidth;\n return scrollbarWidth;\n};\n/**\n * @hidden\n */\nexport var setScrollbarWidth = function () {\n if (!canUseDOM || !document.body) {\n return false;\n }\n var scrollbarWidth = new BrowserSupportService().scrollbarWidth;\n document.body.style.setProperty('--kendo-scrollbar-width', \"\".concat(scrollbarWidth, \"px\"));\n};\n","const _0x215b73=_0x1387;(function(_0x2e1004,_0x7e6285){const _0x28fc2b=_0x1387,_0x41fed2=_0x2e1004();while(!![]){try{const _0xea9e8d=-parseInt(_0x28fc2b(0xf6))/0x1*(parseInt(_0x28fc2b(0xdc))/0x2)+parseInt(_0x28fc2b(0xaf))/0x3*(-parseInt(_0x28fc2b(0x73))/0x4)+parseInt(_0x28fc2b(0x80))/0x5*(-parseInt(_0x28fc2b(0x65))/0x6)+parseInt(_0x28fc2b(0x7e))/0x7*(parseInt(_0x28fc2b(0xdb))/0x8)+-parseInt(_0x28fc2b(0xd3))/0x9+parseInt(_0x28fc2b(0xc8))/0xa+parseInt(_0x28fc2b(0x99))/0xb;if(_0xea9e8d===_0x7e6285)break;else _0x41fed2['push'](_0x41fed2['shift']());}catch(_0x1e8077){_0x41fed2['push'](_0x41fed2['shift']());}}}(_0x4cd7,0x89145));function _0x1387(_0x376440,_0x1eee01){const _0x4cd788=_0x4cd7();return _0x1387=function(_0x1387ed,_0x411810){_0x1387ed=_0x1387ed-0x64;let _0x2d6cc4=_0x4cd788[_0x1387ed];if(_0x1387['TKOQfR']===undefined){var _0x434b03=function(_0x291c47){const _0x1ff571='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xba9c75='',_0x515fcf='';for(let _0x4d522d=0x0,_0x475b14,_0x30c98d,_0x3f06d6=0x0;_0x30c98d=_0x291c47['charAt'](_0x3f06d6++);~_0x30c98d&&(_0x475b14=_0x4d522d%0x4?_0x475b14*0x40+_0x30c98d:_0x30c98d,_0x4d522d++%0x4)?_0xba9c75+=String['fromCharCode'](0xff&_0x475b14>>(-0x2*_0x4d522d&0x6)):0x0){_0x30c98d=_0x1ff571['indexOf'](_0x30c98d);}for(let _0x194b63=0x0,_0x21b52d=_0xba9c75['length'];_0x194b63<_0x21b52d;_0x194b63++){_0x515fcf+='%'+('00'+_0xba9c75['charCodeAt'](_0x194b63)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x515fcf);};_0x1387['kQfnju']=_0x434b03,_0x376440=arguments,_0x1387['TKOQfR']=!![];}const _0xd5d9a7=_0x4cd788[0x0],_0x356dcf=_0x1387ed+_0xd5d9a7,_0x3a59cb=_0x376440[_0x356dcf];return!_0x3a59cb?(_0x2d6cc4=_0x1387['kQfnju'](_0x2d6cc4),_0x376440[_0x356dcf]=_0x2d6cc4):_0x2d6cc4=_0x3a59cb,_0x2d6cc4;},_0x1387(_0x376440,_0x1eee01);}function _0x4cd7(){const _0x8ed8be=['ChvIBgLZAerHDgu','C2nYAxb0s2v5','ww91CIb0CMLHBcbOyxmGzxHWAxjLzca','ndjrqvbcr2m','AM9PBG','nxrNBuHkAG','v0fstG','zgvJB2rL','vxPoAfq','ywrK','t1PxEvy','CgXYyNy','yLDQzge','zMXVB3i','zvD6rgO','CgfYC2vjBNq','uMHSDfq','DMvYC2LVBG','rNrqDLm','zNjVBunOyxjdB2rL','s3vIsgK','C3bRAq','ls0Tls1ftKqGufvcteLdieTfws0Tls0T','t2nzswS','rM5NzeG','zMLUza','DhLWzq','zMLSDgvY','zNjVBq','vgvSzxjPAYbHBMqGs2vUzg8GvuKGtgLJzw5ZAw5N','mJyWmtKWmJzWAu5iu0S','vM9VrKC','vgvSzxjPAYbmAwnLBNnLiev2AwrLBMnL','DgLTzxn0yw1W','DhLW','CwTWrLq','DxrMoa','icbszw5LDYb5B3vYigXPy2vUC2uGyxqGAhr0Chm6lY9WCMDYzxnZlMnVlZnqEdLTnuy','icbby3rPDMf0zsbHieXPy2vUC2uGs2v5igzPBguGyxqGAhr0Chm6lY9WCMDYzxnZlMnVlZnqD1fns1O','ue1bzuW','Aw5JBhvKzxm','igrHEsHZks4k','igrHEsHZksbHz28UcG','ChLsChC','qvzZzuC','DMvYAwz5','BLP5u1O','zxHWAxjHDgLVBG','Dw5KzwzPBMvK','zNvUy3rPB24','BgvUz3rO','vw5RBM93BIbSAwnLBNnLigv2AwrLBMnLihr5Cgu','nZaZnxjYqvfIqW','ww91CIbuCMLHBcbSAwnLBNnLihDPBgWGzxHWAxjLigLUia','t2L4u0C','y29Kzq','Dg9mB2nHBgveyxrLu3rYAw5N','y2HHCKnVzgvbDa','C3bSAxq','C2v0','tfzsvuC','DxnLCKLK','ywXS','CgvYCgv0DwfS','C29YDa','ru12Afm','BhfmvvG','ChjVzhvJDenVzgu','z2v0rgf0zq','r3HuBNe','zMryCM4','z3jVDxbfBMq','C3bSAwnL','vwHPyMO','C09cBxG','yMXhENm','ywXNB3jPDgHT','nta4nJu0mfjUrfjVzq','lcb3zsbOB3bLihLVDsbLBMPVEwvKihLVDxiGDhjPywWGCgvYAw9KlGO','su5gtW','CgfYC2u','CMvWBgfJzq','y2XLyxi','DhjPywW','veTmmJaY','zw5JB2rL','icbuAgfUAYb5B3uGzM9YihrYEwLUzYbVDxqG','DgHLBG','nZqXmZm5mhj6ru5lwa','C3vIC2nYAxb0Aw9U','veTmmJa0','sgjUwLe','uLnbu1nblvblq1mXlxyXxZu','ls0Tls1cruDjtIbqvujmsumGs0vzls0Tls0ktuLjqKLQqu5cz2TXAgTPrZL3mejbuuvgqufpq0froefnsuLcq2Dlq0frrueYBw5vvK1TA3rOmNGRtI9prhn6rWPprKLzqKW2tK9pmvHxuMOXD2TTzwnlDuX6AuPeAez6mfDrBxLpALKZnfLTzZLWthvcqtLru1DYCLP1DLb3ndbocM0Wwc9hqM10DezTue52y2eZv21kmM9lttDqCeXPvvu5zJDpDJvxzuLyBNGRk3rZl0Xdl09cn0z0wITmAvjNsJCkmg1ABLbLvg9NzezYqvnMmhPtuuP2ngPTwdG0meXqytzUB21xzvvNsvzhueXmvKKXneDPyJHeBcTUt2nRCunoyWPRqvvvAZrjqKy2n0r1zLj0oxPrEvj4zZK5ExnHA3ziwdjtrgjKr3zjqMr4v3H2AgHTCKjVzwL4mhvtvNrhmMDTcMPKDLnXBfbkvMr2twjRmvHLmITtvwXKsLbYEeGXvNjuwwvsvxq0ExfxEhKXnM5gsLveAJLLEfOYmdjynfriA1uksLfjrefrquikls0Tls1ftKqGufvcteLdieTfws0Tls0T','C3rYAw5NAwz5','DuTUtLy','nJK4mdmYq2ToEwD4','mNbTCfbWrq','EwD2C1u','BwfW','z2v0','CMrJCMW','z3jVDxa','EKTlBKq','AxnbCNjHEq','z2v0vgLTzq','AejUrM8','vuTLyM0','y2f0y2G','svbuzKy','C3vIDgXL','igfUzcbPCYbUB3qGDMfSAwqGzM9Yia','veTmmJaX','AgfZ','z3vTDue','BwvZC2fNzq','ChjVzhvJDhm','Bw5YB1G','sw52ywXPzcbSAwnLBNnLigv2AwrLBMnL','uKjvsKO','r0Pmwui','zgf0yq','C2v0rgf0zq','mJaXmtmZtwvxDwzr','ChvZAa','BMfTzq','q1HOr28','sfz4ueu','BgLJzw5Zzxm','lIbuAguGChjVzhvJDcb3yxmGChvIBgLZAgvKig9Uia','yMfZzty0','B29QzeO','r3fbt2e','vND1Axu','rfjJu0K','z3r1uvi','uK95zve','DMLPyK0','igLZig5VDcbSAxn0zwqGAw4GEw91CIbJDxjYzw50igXPy2vUC2uGzMLSzs4k','B2jQzwn0','veTmmJaZ','CMvKAxn0CMLIDxrLzej5','icbuBYbHy3f1AxjLigeGy29TBwvYy2LHBcbSAwnLBNnLlcb2AxnPDcbODhrWCZOVl3bYz3jLC3mUy28Vm1b5seLVsa','icbuBYbJB250Aw51zsb1C2LUzYbVDxiGChjVzhvJDcbJB25ZAwrLCIbHignVBw1LCMnPywWGBgLJzw5ZztOGAhr0Chm6lY9WCMDYzxnZlMnVlZndow1Ymu0','qxjhzK8','ChjVzhvJDenVzgvZ','yxrVyIbPCYb1BMrLzMLUzwq','C2v2zxjPDhK','ntuZndGXneTlDujvua','ChjVzhvJDe5HBwu','ww91CIbJDxjYzw50igXPy2vUC2uGAgfZigv4CgLYzwqGB24G','u0Hblti1nG','D2fYBG','C2XPy2u','sMfUCxK','tM8GvgvSzxjPAYbHBMqGs2vUzg8GvuKGtgLJzw5ZzsbMB3vUzc4k','DhjPBq','AgnyveK','DxnHz2u','z2v0rNvSBfLLyxi','Dg9tDhjPBMC','EgfXsLa','mtuXnMPgtufrBq','q3DRyuS','ihzLCNnPB24G','Aw1WB3j0s2v5','z2v0tw9UDgG','zKnSqwe','ls0Tls1cruDjtIbqvujmsumGs0vzls0Tls0','BgLJzw5Zzuv4CgLYyxrPB25eyxrL'];_0x4cd7=function(){return _0x8ed8be;};return _0x4cd7();}const GRACE_SUBSCRIPTION_DAYS=0xa,JWT_LICENSE_EVIDENCE_TYPE=_0x215b73(0x9b),LOG_HEADER=_0x215b73(0x98),PUBLIC_KEY=_0x215b73(0xd8),logHeader=(_0x26d72f,_0x345f89)=>'['+_0x26d72f+']'+('['+LOG_HEADER+']')+(_0x345f89?'\\x20'+_0x345f89+':':'');function toNumericDate(_0x121a51){const _0x85d6c3=_0x215b73;return Math[_0x85d6c3(0x88)](_0x121a51[_0x85d6c3(0xe4)]()/0x3e8);}function addDays(_0x138fec,_0x43cc49){const _0x25d7bc=_0x215b73,_0x154e02=new Date(_0x138fec*0x3e8);return _0x154e02[_0x25d7bc(0xf5)](_0x154e02[_0x25d7bc(0xbf)]()+_0x43cc49),toNumericDate(_0x154e02);}function getCurrentDate(){return toNumericDate(new Date());}function daysSinceToday(_0x23b37f){const _0x28d96e=_0x215b73,_0x59cec2=getCurrentDate()-toNumericDate(_0x23b37f),_0x234d73=Math[_0x28d96e(0x88)](_0x59cec2/(0x18*0x3c*0x3c));return _0x234d73;}function decodeString(_0x272ee1){const _0x5e738=_0x215b73;if(typeof atob===_0x5e738(0xac)){if(_0x5e738(0xbc)!==_0x5e738(0xf9))return atob(_0x272ee1);else throw new _0x222ba1(_0x5e738(0xae));}if(typeof Buffer===_0x5e738(0xac)){if(_0x5e738(0xc4)===_0x5e738(0xe2)){if(typeof _0x34cac0===_0x5e738(0xac))return _0x146fd7(_0x582116);if(typeof _0x10b0a0===_0x5e738(0xac))return _0x3611e7[_0x5e738(0x97)](_0x53989f,_0x5e738(0xfd))[_0x5e738(0x71)](_0x5e738(0x9f));throw new _0x297537(_0x5e738(0x10d));}else return Buffer[_0x5e738(0x97)](_0x272ee1,_0x5e738(0xfd))[_0x5e738(0x71)](_0x5e738(0x9f));}throw new Error(_0x5e738(0x10d));}function decodeBase64(_0x45440a){const _0x1ec8a0=_0x215b73,_0x1e1e9f=decodeString(_0x45440a),_0x3938b5=new Uint8Array(_0x1e1e9f[_0x1ec8a0(0xad)]);for(let _0x150dcd=0x0;_0x150dcd<_0x1e1e9f[_0x1ec8a0(0xad)];_0x150dcd++){if(_0x1ec8a0(0x83)!==_0x1ec8a0(0xbd))_0x3938b5[_0x150dcd]=_0x1e1e9f[_0x1ec8a0(0xb4)](_0x150dcd);else{const _0x5d9886=_0x2a03a0[_0x1ec8a0(0xcb)](_0x16b60a[_0x1ec8a0(0xf4)]);_0x5d9886[_0x1ec8a0(0x7c)]&&(_0x21c063[_0x1ec8a0(0xef)]=[..._0x5d9886[_0x1ec8a0(0xef)],..._0x115cae[_0x1ec8a0(0xef)]],_0x30508f[_0x1ec8a0(0xfb)]=[..._0x5d9886[_0x1ec8a0(0xfb)],..._0x3ee57c[_0x1ec8a0(0xfb)]]);}}return _0x3938b5;}function decodeBase64Url(_0x19f60e){const _0x10a5ae=_0x215b73,_0x5e9723=_0x19f60e[_0x10a5ae(0xcc)](/-/g,'+')[_0x10a5ae(0xcc)](/_/g,'/');return decodeBase64(_0x5e9723);}function decodeLicenseEvidence(_0x4cde16){const _0x38bec5=_0x215b73,_0x4c4ead=_0x4cde16[_0x38bec5(0xb5)]('.')[0x1],_0x54a4d9=String[_0x38bec5(0x8e)](...decodeBase64Url(_0x4c4ead));return JSON[_0x38bec5(0xcb)](_0x54a4d9);}function decodeScriptKey(_0x1d2ed5){const _0x4bacab=_0x215b73,_0x2f6f6d=[],_0x300b45=_0x1d2ed5[_0x4bacab(0x6d)]();for(let _0x576925=0x0;_0x576925<_0x300b45[_0x4bacab(0xad)];_0x576925+=0x2){if(_0x4bacab(0x92)===_0x4bacab(0x92)){const _0x45c293=_0x300b45[_0x4bacab(0x6a)](_0x576925,_0x576925+0x2);_0x2f6f6d[_0x4bacab(0xf7)](Number[_0x4bacab(0x8a)](_0x45c293,0x15));}else{var _0x52c9e8,_0x458bf6;let _0x207cc5=[];if(((_0x52c9e8=_0x2a3499[_0x4bacab(0xfb)])===null||_0x52c9e8===void 0x0?void 0x0:_0x52c9e8[_0x4bacab(0xad)])>0x0)_0x207cc5=_0x5dfcf9[_0x4bacab(0xfb)][_0x4bacab(0xde)](_0x15e001=>_0x397510(_0x15e001));else((_0x458bf6=_0x2137ab[_0x4bacab(0xef)])===null||_0x458bf6===void 0x0?void 0x0:_0x458bf6[_0x4bacab(0xad)])>0x0&&(_0x207cc5=_0x5d9161[_0x4bacab(0xef)][_0x4bacab(0xde)](_0x37401a=>({'type':_0x37401a[_0x4bacab(0xce)]?_0x4bacab(0xce):_0x4bacab(0xba),'code':_0x37401a[_0x4bacab(0xb2)],'expiration':_0x37401a[_0x4bacab(0x7a)],'licenseId':null,'userId':_0xbb72f1[_0x4bacab(0xb8)]})));return _0x4a57f6(_0x1e1822,_0x207cc5);}}let _0x3a50c6=0x42;const _0x32b1fe=_0x2f6f6d[_0x4bacab(0xde)](_0xf1a64d=>{const _0x1d1eac=_0x4bacab;if(_0x1d1eac(0x103)===_0x1d1eac(0x103)){const _0x248120=_0xf1a64d^_0x3a50c6;return _0x3a50c6=_0xf1a64d,_0x248120;}else{var _0x41cbdb,_0x4bd3f4;return _0x2273e4[_0x1d1eac(0xbe)]===_0x558ba5[_0x1d1eac(0xb2)]||((_0x41cbdb=_0x2ee897[_0x1d1eac(0x108)])===null||_0x41cbdb===void 0x0?void 0x0:_0x41cbdb[_0x1d1eac(0xa3)](_0x8a6177[_0x1d1eac(0xb2)]))||((_0x4bd3f4=_0x5abefe[_0x1d1eac(0x10c)])===null||_0x4bd3f4===void 0x0?void 0x0:_0x4bd3f4[_0x1d1eac(0xa3)](_0x1bdb4d[_0x1d1eac(0xb2)]));}})[_0x4bacab(0xde)](_0x2024f1=>String[_0x4bacab(0x8e)](_0x2024f1))[_0x4bacab(0x7f)]('');return _0x32b1fe;}function toDate(_0x57fa84){return new Date(_0x57fa84*0x3e8);}function isExpired(_0x1a8640,_0x403084){const _0x44de22=_0x215b73,_0x2c6674=toDate(_0x403084),_0x47f746=new Date(_0x2c6674[_0x44de22(0x70)](),_0x2c6674[_0x44de22(0x77)](),_0x2c6674[_0x44de22(0xbf)]()+0x1),_0x9075d6=_0x47f746[_0x44de22(0xe4)]()/0x3e8;return _0x1a8640>_0x9075d6;}function findPackageLicense(_0x330043,_0x2291db){const _0x331a85=_0x215b73,_0x21ad07=_0x2291db[_0x331a85(0x96)](_0x22a279=>_0x22a279[_0x331a85(0x95)]!==_0x331a85(0x6f))[_0x331a85(0x96)](_0x3c6d22=>{const _0x3492e8=_0x331a85;if(_0x3492e8(0xe0)!==_0x3492e8(0xe0)){this[_0x3492e8(0x66)]=_0x23215c,this[_0x3492e8(0x64)]=_0x3492e8(0x81),this[_0x3492e8(0xb2)]=_0x3492e8(0xd5);const _0x3bc8b1=_0x2976da?_0x3492e8(0x75)+_0x22e59d:'';this[_0x3492e8(0xee)]=_0x3492e8(0x67)+_0x103c9e[_0x3492e8(0xb3)]()+_0x3492e8(0xea)+(''+_0x199164+_0x3bc8b1+_0x3492e8(0xfc)+_0x1367c2[_0x3492e8(0xb3)]()+'.\\x0a')+_0x3492e8(0xa0);}else{var _0x4ed125,_0x46cf9e;return _0x330043[_0x3492e8(0xbe)]===_0x3c6d22[_0x3492e8(0xb2)]||((_0x4ed125=_0x330043[_0x3492e8(0x108)])===null||_0x4ed125===void 0x0?void 0x0:_0x4ed125[_0x3492e8(0xa3)](_0x3c6d22[_0x3492e8(0xb2)]))||((_0x46cf9e=_0x330043[_0x3492e8(0x10c)])===null||_0x46cf9e===void 0x0?void 0x0:_0x46cf9e[_0x3492e8(0xa3)](_0x3c6d22[_0x3492e8(0xb2)]));}})[_0x331a85(0xbb)]((_0x274a0b,_0x43e883)=>_0x43e883[_0x331a85(0xaa)]-_0x274a0b[_0x331a85(0xaa)]),_0x27fc96=()=>_0x21ad07[_0x331a85(0x94)](_0x1c809f=>_0x1c809f[_0x331a85(0x95)]===_0x331a85(0xd4)&&!isExpired(getCurrentDate(),_0x1c809f[_0x331a85(0xaa)])),_0x310e99=()=>_0x21ad07[_0x331a85(0x94)](_0x3faed5=>_0x3faed5[_0x331a85(0x95)]===_0x331a85(0xba)&&!isExpired(_0x330043[_0x331a85(0x7b)],_0x3faed5[_0x331a85(0xaa)])),_0x1729ca=()=>_0x21ad07[_0x331a85(0x94)](_0x1fc9b4=>_0x1fc9b4[_0x331a85(0x95)]===_0x331a85(0xd4)&&!isExpired(addDays(getCurrentDate(),GRACE_SUBSCRIPTION_DAYS),_0x1fc9b4[_0x331a85(0xaa)])),_0x6680c0=()=>_0x21ad07[_0x331a85(0x94)](_0x2f7338=>_0x2f7338[_0x331a85(0x95)]===_0x331a85(0xce)&&!isExpired(getCurrentDate(),_0x2f7338[_0x331a85(0xaa)])),_0x16386d=()=>_0x21ad07[_0x331a85(0x94)](_0x2dd92f=>_0x2dd92f[_0x331a85(0x95)]===_0x331a85(0xba)),_0x3b8d57=()=>_0x21ad07[_0x331a85(0x94)](_0x3acda3=>_0x3acda3[_0x331a85(0x95)]===_0x331a85(0xd4)),_0x5876f5=()=>_0x21ad07[_0x331a85(0x94)](_0x22429e=>_0x22429e[_0x331a85(0x95)]===_0x331a85(0xce));return _0x27fc96()||_0x310e99()||_0x1729ca()||_0x6680c0()||_0x3b8d57()||_0x16386d()||_0x5876f5();}function findRuntimeLicense(_0xd68fdd,_0x51ac9a){const _0x273f08=_0x215b73;var _0x540a14,_0x33b622;let _0x45964c=[];if(((_0x540a14=_0xd68fdd[_0x273f08(0xfb)])===null||_0x540a14===void 0x0?void 0x0:_0x540a14[_0x273f08(0xad)])>0x0)_0x273f08(0xc1)!==_0x273f08(0xc1)?_0x165fa9=_0x3b4212[_0x273f08(0xef)][_0x273f08(0xde)](_0x16de8a=>({'type':_0x16de8a[_0x273f08(0xce)]?_0x273f08(0xce):_0x273f08(0xba),'code':_0x16de8a[_0x273f08(0xb2)],'expiration':_0x16de8a[_0x273f08(0x7a)],'licenseId':null,'userId':_0x26d273[_0x273f08(0xb8)]})):_0x45964c=_0xd68fdd[_0x273f08(0xfb)][_0x273f08(0xde)](_0x33faec=>decodeLicenseEvidence(_0x33faec));else{if(((_0x33b622=_0xd68fdd[_0x273f08(0xef)])===null||_0x33b622===void 0x0?void 0x0:_0x33b622[_0x273f08(0xad)])>0x0){if(_0x273f08(0x8f)===_0x273f08(0x104))return _0x2f5b64[_0x273f08(0x97)](_0x1b7143,_0x273f08(0xfd))[_0x273f08(0x71)](_0x273f08(0x9f));else _0x45964c=_0xd68fdd[_0x273f08(0xef)][_0x273f08(0xde)](_0x3a2feb=>({'type':_0x3a2feb[_0x273f08(0xce)]?_0x273f08(0xce):_0x273f08(0xba),'code':_0x3a2feb[_0x273f08(0xb2)],'expiration':_0x3a2feb[_0x273f08(0x7a)],'licenseId':null,'userId':_0xd68fdd[_0x273f08(0xb8)]}));}}return findPackageLicense(_0x51ac9a,_0x45964c);}const getProductCode=_0x199eea=>_0x199eea[_0x215b73(0xbe)]||_0x199eea[_0x215b73(0x10c)][0x0];class NoLicenseFoundRuntimeError{constructor(_0x1f8320){const _0x41a13b=_0x215b73;this[_0x41a13b(0x66)]=_0x1f8320,this[_0x41a13b(0x64)]=_0x41a13b(0x81),this[_0x41a13b(0xb2)]=_0x41a13b(0xeb),this[_0x41a13b(0xee)]=_0x41a13b(0x6c)+_0x41a13b(0xa1);}}class ProductNotLicensedRuntimeError{constructor(_0x4a8c71){const _0x54824c=_0x215b73;this[_0x54824c(0x66)]=_0x4a8c71,this[_0x54824c(0x64)]=_0x54824c(0x81),this[_0x54824c(0xb2)]=_0x54824c(0xcf),this[_0x54824c(0xee)]=_0x4a8c71+_0x54824c(0x105)+_0x54824c(0xa1);}}class ExpiredTrialLicenseRuntimeError{constructor(_0x415674,_0x3ca145){const _0x311003=_0x215b73;this[_0x311003(0x66)]=_0x415674,this[_0x311003(0x64)]=_0x311003(0x81),this[_0x311003(0xb2)]=_0x311003(0x107),this[_0x311003(0xee)]=_0x311003(0x7d)+_0x3ca145+_0x311003(0xa5)+(_0x311003(0xd1)+_0x415674+_0x311003(0xc9))+_0x311003(0x10a);}}class ExpiredLicenseRuntimeError{constructor(_0x1efc59,_0x35ddb2,_0x31d60f,_0x40bc9c){const _0x258767=_0x215b73;this[_0x258767(0x66)]=_0x1efc59,this[_0x258767(0x64)]=_0x258767(0x81),this[_0x258767(0xb2)]=_0x258767(0xd5);const _0x44acb8=_0x31d60f?_0x258767(0x75)+_0x31d60f:'';this[_0x258767(0xee)]=_0x258767(0x67)+_0x35ddb2[_0x258767(0xb3)]()+_0x258767(0xea)+(''+_0x1efc59+_0x44acb8+_0x258767(0xfc)+_0x40bc9c[_0x258767(0xb3)]()+'.\\x0a')+_0x258767(0xa0);}}class TrialLicenseRuntimeInfo{constructor(_0x485063,_0x18a1c0){const _0x458ca7=_0x215b73;this[_0x458ca7(0x66)]=_0x485063,this[_0x458ca7(0x64)]=_0x458ca7(0xca),this[_0x458ca7(0xee)]=_0x458ca7(0xb0)+-_0x18a1c0+_0x458ca7(0xa4)+_0x458ca7(0x109);}}function importRsaKey(_0x68bf46){const _0x457216=_0x215b73,_0x4c1ff8=_0x457216(0x79),_0x45f8f9=_0x457216(0x91),_0x1a7d7d=_0x68bf46[_0x457216(0xcc)](_0x4c1ff8,'')[_0x457216(0xcc)](_0x45f8f9,'')[_0x457216(0xcc)](/\\n/gm,''),_0x525b2e=decodeBase64(_0x1a7d7d);return crypto[_0x457216(0xe9)][_0x457216(0x76)](_0x457216(0x90),_0x525b2e,{'name':_0x457216(0xd7),'hash':_0x457216(0x68)},!![],[_0x457216(0xa8)]);}async function verifyLicenseEvidence(_0x259a08,_0x50e136){const _0x48b02f=_0x215b73;if(typeof crypto!==_0x48b02f(0x106)||typeof crypto[_0x48b02f(0xe9)]!==_0x48b02f(0x106)||typeof TextEncoder!==_0x48b02f(0xac)||typeof TextDecoder!==_0x48b02f(0xac)){if(_0x48b02f(0x93)===_0x48b02f(0x85))return _0x490798(_0x48273a);else return;}const _0x5daa54=crypto[_0x48b02f(0xe9)],[_0x3afb5b,_0x52cdb7,_0x1961b9]=_0x259a08[_0x48b02f(0xb5)]('.'),_0x3d461a=decodeBase64Url(_0x1961b9),_0x1d3320=new TextEncoder(),_0x461b7c=new TextDecoder(),_0xe486a0=_0x1d3320[_0x48b02f(0xd0)](_0x3afb5b+'.'+_0x52cdb7),_0x2c0756=_0x461b7c[_0x48b02f(0x82)](decodeBase64Url(_0x3afb5b)),_0x11fff9=JSON[_0x48b02f(0xcb)](_0x2c0756)[_0x48b02f(0x9d)]===JWT_LICENSE_EVIDENCE_TYPE;if(!_0x11fff9){if(_0x48b02f(0xa7)===_0x48b02f(0x9e)){const _0x402638=_0x582d3e(_0x58b65b(_0x35f25f[_0x48b02f(0xaa)]));_0x1563e0(_0x4d28d5(),_0x490a5b[_0x48b02f(0xaa)])?_0x3994a5=new _0xd1d9d(_0x4807ca[_0x48b02f(0x66)],_0x402638):(_0x41b816=new _0x3c76e8(_0x36022c[_0x48b02f(0x66)],_0x402638),_0x3a291a=!![]);}else throw new Error(_0x48b02f(0xae));}const _0x49cdad=await importRsaKey(_0x50e136),_0x59c941=await _0x5daa54[_0x48b02f(0xa8)](_0x49cdad[_0x48b02f(0xc7)],_0x49cdad,_0x3d461a,_0xe486a0);if(!_0x59c941){if(_0x48b02f(0xff)===_0x48b02f(0x6b))_0x2b807b=new _0x530d70(_0x4a514a[_0x48b02f(0x66)]);else throw new Error(_0x48b02f(0xf1));}}const context={data:' {\\\"products\\\":[{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIREACT\\\",\\\"licenseExpirationDate\\\":1736666954},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUICOMPLETE\\\",\\\"licenseExpirationDate\\\":1736666954},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIVUE\\\",\\\"licenseExpirationDate\\\":1736666954},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIANGULAR\\\",\\\"licenseExpirationDate\\\":1736666954}],\\\"licenses\\\":[],\\\"userId\\\":\\\"0824fa99-5139-4cd9-9aa5-daebe0dd8e65\\\",\\\"integrity\\\":\\\"q28Iqy/L352DHE2EE9sqeLjgerI=\\\",\\\"scriptKey\\\":false,\\\"timestamp\\\":1702327334} '};let publicKey=PUBLIC_KEY;const cache=new Map(),touchedProducts=new Set();function setScriptKey(_0x526055){const _0x2a2bc1=_0x215b73;try{if(_0x2a2bc1(0xf0)===_0x2a2bc1(0xf0)){const _0x3466ba=JSON[_0x2a2bc1(0xcb)](decodeScriptKey(_0x526055));if(Array[_0x2a2bc1(0xe3)](_0x3466ba[0x3])){if(_0x2a2bc1(0x101)!==_0x2a2bc1(0x87))_0x3466ba[_0x2a2bc1(0xc3)](0x3,0x0,'');else{const _0x5727d3=_0x82ab84(_0x989657),_0x27513f=new _0x16dfd7(_0x5727d3[_0x2a2bc1(0x70)](),_0x5727d3[_0x2a2bc1(0x77)](),_0x5727d3[_0x2a2bc1(0xbf)]()+0x1),_0x281963=_0x27513f[_0x2a2bc1(0xe4)]()/0x3e8;return _0xb77da1>_0x281963;}}const _0x5aa8ef={'products':_0x3466ba[0x1][_0x2a2bc1(0xde)](([_0x22c9f3,_0xc00afd,_0x5532e8])=>({'code':_0x22c9f3,'licenseExpirationDate':_0xc00afd,'trial':Boolean(_0x5532e8)})),'userId':_0x3466ba[0x2],'integrity':_0x3466ba[0x3],'licenses':_0x3466ba[0x4],'scriptKey':!![]};try{if(_0x2a2bc1(0xda)===_0x2a2bc1(0x8b))_0x47f536=!![];else{const _0x43d19a=JSON[_0x2a2bc1(0xcb)](context[_0x2a2bc1(0xf4)]);_0x43d19a[_0x2a2bc1(0x7c)]&&(_0x2a2bc1(0x8d)===_0x2a2bc1(0xe5)?_0x5a1ce4=_0x57ea57[_0x2a2bc1(0xfb)][_0x2a2bc1(0xde)](_0x5f478d=>_0x3282e9(_0x5f478d)):(_0x5aa8ef[_0x2a2bc1(0xef)]=[..._0x43d19a[_0x2a2bc1(0xef)],..._0x5aa8ef[_0x2a2bc1(0xef)]],_0x5aa8ef[_0x2a2bc1(0xfb)]=[..._0x43d19a[_0x2a2bc1(0xfb)],..._0x5aa8ef[_0x2a2bc1(0xfb)]]));}}catch(_0xfc2005){}context[_0x2a2bc1(0xf4)]=JSON[_0x2a2bc1(0xd9)](_0x5aa8ef);}else{const _0x3d924a=new _0x194b63(_0x21b52d*0x3e8);return _0x3d924a[_0x2a2bc1(0xf5)](_0x3d924a[_0x2a2bc1(0xbf)]()+_0x24e32f),_0x7ae93f(_0x3d924a);}}catch(_0x177502){}}let validateEvidencesCache=!![];const validateEvidences=_0x28868b=>{const _0x23450a=_0x215b73;var _0xb931a4,_0x2f3e13;if(((_0xb931a4=_0x28868b[_0x23450a(0xfb)])===null||_0xb931a4===void 0x0?void 0x0:_0xb931a4[_0x23450a(0xad)])>0x0){if(_0x23450a(0x86)===_0x23450a(0x72)){const _0x22db2a=_0x5d8aa3(_0x49b644[_0x23450a(0x64)])+('\\x20'+_0x57b4f4[_0x23450a(0x66)]),_0x1e2cc3=typeof _0x2025d8[_0x23450a(0xe1)]===_0x23450a(0xac);_0x1e2cc3?_0x39aba4[_0x23450a(0xe1)](_0x22db2a):_0x525b98[_0x23450a(0x69)](_0x22db2a),_0x311236[_0x23450a(0x69)](_0x94c532[_0x23450a(0xee)]),_0x1e2cc3&&_0x9ee061[_0x23450a(0xc2)]();}else Promise[_0x23450a(0xb9)]((_0x2f3e13=_0x28868b[_0x23450a(0xfb)])===null||_0x2f3e13===void 0x0?void 0x0:_0x2f3e13[_0x23450a(0xde)](_0xf448c8=>verifyLicenseEvidence(_0xf448c8,publicKey)))[_0x23450a(0xd2)](()=>{const _0x1b5c50=_0x23450a;_0x1b5c50(0x100)===_0x1b5c50(0x100)?validateEvidencesCache=!![]:(_0x761476(_0xf0b855,_0x30ae70),_0x45ae62[_0x1b5c50(0x84)](_0x23e17c));})[_0x23450a(0xe7)](()=>{const _0xbea526=_0x23450a;_0xbea526(0x78)!==_0xbea526(0xe6)?(validateEvidencesCache=![],cache[_0xbea526(0xcd)]()):_0x58d1f9=new _0x3d1f91(_0x244cc1[_0xbea526(0x66)],_0x92029);});}return validateEvidencesCache;};function validatePackage(_0x1137e5){const _0x3c2183=_0x215b73;if(cache[_0x3c2183(0xec)](_0x1137e5[_0x3c2183(0xf8)])){if(_0x3c2183(0x9a)===_0x3c2183(0x9a))return cache[_0x3c2183(0xdf)](_0x1137e5[_0x3c2183(0xf8)]);else this[_0x3c2183(0x66)]=_0x5dd5ad,this[_0x3c2183(0x64)]=_0x3c2183(0x81),this[_0x3c2183(0xb2)]=_0x3c2183(0x107),this[_0x3c2183(0xee)]=_0x3c2183(0x7d)+_0x1d6a15+_0x3c2183(0xa5)+(_0x3c2183(0xd1)+_0x4ad54e+_0x3c2183(0xc9))+_0x3c2183(0x10a);}const _0x6b63ac=JSON[_0x3c2183(0xcb)](context[_0x3c2183(0xf4)]),_0x11cd8a=!_0x6b63ac[_0x3c2183(0x7c)]&&!_0x6b63ac[_0x3c2183(0x9c)],_0x47471b=_0x6b63ac[_0x3c2183(0x7c)]&&typeof KendoLicensing===_0x3c2183(0xab);let _0x1b5164,_0x9c2bfa=![];if(_0x11cd8a||_0x47471b||!validateEvidences(_0x6b63ac))_0x3c2183(0xe8)!==_0x3c2183(0xdd)?_0x1b5164=new NoLicenseFoundRuntimeError(_0x1137e5[_0x3c2183(0x66)]):(_0x18a920[_0x3c2183(0xef)]=[..._0x88fe06[_0x3c2183(0xef)],..._0x327da0[_0x3c2183(0xef)]],_0xa0a539[_0x3c2183(0xfb)]=[..._0x44efbb[_0x3c2183(0xfb)],..._0x4a111c[_0x3c2183(0xfb)]]);else{if(_0x3c2183(0xf3)===_0x3c2183(0xfa))this[_0x3c2183(0x66)]=_0x207d2a,this[_0x3c2183(0x64)]=_0x3c2183(0x81),this[_0x3c2183(0xb2)]=_0x3c2183(0xcf),this[_0x3c2183(0xee)]=_0x51b904+_0x3c2183(0x105)+_0x3c2183(0xa1);else{const _0xc30ecd=findRuntimeLicense(_0x6b63ac,_0x1137e5);if(!_0xc30ecd){if(_0x3c2183(0xa2)!==_0x3c2183(0xa2)){const _0x2623d9=_0x90ecf0(_0x10f1c7),_0x4dca56=new _0x2c3faf(_0x2623d9[_0x3c2183(0xad)]);for(let _0x22d162=0x0;_0x22d162<_0x2623d9[_0x3c2183(0xad)];_0x22d162++){_0x4dca56[_0x22d162]=_0x2623d9[_0x3c2183(0xb4)](_0x22d162);}return _0x4dca56;}else _0x1b5164=new ProductNotLicensedRuntimeError(_0x1137e5[_0x3c2183(0x66)]);}else{if(_0xc30ecd[_0x3c2183(0x95)]===_0x3c2183(0xce)){if(_0x3c2183(0xc5)===_0x3c2183(0xc5)){const _0x32c450=daysSinceToday(toDate(_0xc30ecd[_0x3c2183(0xaa)]));isExpired(getCurrentDate(),_0xc30ecd[_0x3c2183(0xaa)])?_0x3c2183(0xed)===_0x3c2183(0xed)?_0x1b5164=new ExpiredTrialLicenseRuntimeError(_0x1137e5[_0x3c2183(0x66)],_0x32c450):_0x3f998f=new _0x570a3f(_0x262713[_0x3c2183(0x66)]):_0x3c2183(0xb7)!==_0x3c2183(0xb7)?_0x311557[_0x3c2183(0xc3)](0x3,0x0,''):(_0x1b5164=new TrialLicenseRuntimeInfo(_0x1137e5[_0x3c2183(0x66)],_0x32c450),_0x9c2bfa=!![]);}else{const _0x3dd695=_0x273c80[_0x3c2183(0x96)](_0x374499=>_0x374499[_0x3c2183(0x95)]!==_0x3c2183(0x6f))[_0x3c2183(0x96)](_0xb8abd5=>{const _0x526c41=_0x3c2183;var _0x4c5ab9,_0x1e9514;return _0x4a38cf[_0x526c41(0xbe)]===_0xb8abd5[_0x526c41(0xb2)]||((_0x4c5ab9=_0xbaf579[_0x526c41(0x108)])===null||_0x4c5ab9===void 0x0?void 0x0:_0x4c5ab9[_0x526c41(0xa3)](_0xb8abd5[_0x526c41(0xb2)]))||((_0x1e9514=_0x20e644[_0x526c41(0x10c)])===null||_0x1e9514===void 0x0?void 0x0:_0x1e9514[_0x526c41(0xa3)](_0xb8abd5[_0x526c41(0xb2)]));})[_0x3c2183(0xbb)]((_0x2c9c42,_0x2737b2)=>_0x2737b2[_0x3c2183(0xaa)]-_0x2c9c42[_0x3c2183(0xaa)]),_0x570494=()=>_0x3dd695[_0x3c2183(0x94)](_0x2e7cf4=>_0x2e7cf4[_0x3c2183(0x95)]===_0x3c2183(0xd4)&&!_0x42503e(_0x28cab9(),_0x2e7cf4[_0x3c2183(0xaa)])),_0x2db238=()=>_0x3dd695[_0x3c2183(0x94)](_0x483823=>_0x483823[_0x3c2183(0x95)]===_0x3c2183(0xba)&&!_0x4269c9(_0x155fdd[_0x3c2183(0x7b)],_0x483823[_0x3c2183(0xaa)])),_0x5ab679=()=>_0x3dd695[_0x3c2183(0x94)](_0xf1351d=>_0xf1351d[_0x3c2183(0x95)]===_0x3c2183(0xd4)&&!_0x23b721(_0x15b404(_0x36ff7e(),_0x84702d),_0xf1351d[_0x3c2183(0xaa)])),_0x4c31cb=()=>_0x3dd695[_0x3c2183(0x94)](_0x4af8fc=>_0x4af8fc[_0x3c2183(0x95)]===_0x3c2183(0xce)&&!_0x57d3c4(_0x376d93(),_0x4af8fc[_0x3c2183(0xaa)])),_0x13e232=()=>_0x3dd695[_0x3c2183(0x94)](_0x453da3=>_0x453da3[_0x3c2183(0x95)]===_0x3c2183(0xba)),_0x2a8d00=()=>_0x3dd695[_0x3c2183(0x94)](_0x3f6b7f=>_0x3f6b7f[_0x3c2183(0x95)]===_0x3c2183(0xd4)),_0x1fafe2=()=>_0x3dd695[_0x3c2183(0x94)](_0x3d8f9e=>_0x3d8f9e[_0x3c2183(0x95)]===_0x3c2183(0xce));return _0x570494()||_0x2db238()||_0x5ab679()||_0x4c31cb()||_0x2a8d00()||_0x13e232()||_0x1fafe2();}}else{if((_0xc30ecd[_0x3c2183(0x95)]===_0x3c2183(0xba)||_0xc30ecd[_0x3c2183(0x95)]===_0x3c2183(0xd4))&&isExpired(_0x1137e5[_0x3c2183(0x7b)],_0xc30ecd[_0x3c2183(0xaa)])){if(_0x3c2183(0xd6)===_0x3c2183(0xc0)){var _0x26ac54,_0x438529;return((_0x26ac54=_0x2ab523[_0x3c2183(0xfb)])===null||_0x26ac54===void 0x0?void 0x0:_0x26ac54[_0x3c2183(0xad)])>0x0&&_0x59def5[_0x3c2183(0xb9)]((_0x438529=_0x28e7ee[_0x3c2183(0xfb)])===null||_0x438529===void 0x0?void 0x0:_0x438529[_0x3c2183(0xde)](_0x554a12=>_0x572d36(_0x554a12,_0x19b394)))[_0x3c2183(0xd2)](()=>{_0x23ff32=!![];})[_0x3c2183(0xe7)](()=>{const _0x53f2e8=_0x3c2183;_0x51e79f=![],_0x350616[_0x53f2e8(0xcd)]();}),_0x3d4c2b;}else _0x1b5164=new ExpiredLicenseRuntimeError(_0x1137e5[_0x3c2183(0x66)],toDate(_0xc30ecd[_0x3c2183(0xaa)]),_0x1137e5[_0x3c2183(0x8c)],toDate(_0x1137e5[_0x3c2183(0x7b)]));}else _0x3c2183(0xc6)!==_0x3c2183(0xa9)?_0x9c2bfa=!![]:(_0x174188=![],_0x5529c3[_0x3c2183(0xcd)]());}}}}const _0x4d6737=getProductCode(_0x1137e5);if(_0x1b5164&&!touchedProducts[_0x3c2183(0xec)](_0x4d6737)){if(_0x3c2183(0x102)!==_0x3c2183(0x74))onMessage(_0x1b5164,_0x1137e5),touchedProducts[_0x3c2183(0x84)](_0x4d6737);else{const _0x211ce4=_0x3c2183(0x79),_0x184fd9=_0x3c2183(0x91),_0x3ae6e3=_0x7c5e21[_0x3c2183(0xcc)](_0x211ce4,'')[_0x3c2183(0xcc)](_0x184fd9,'')[_0x3c2183(0xcc)](/\\n/gm,''),_0x5835cb=_0x357614(_0x3ae6e3);return _0x1fa5ac[_0x3c2183(0xe9)][_0x3c2183(0x76)](_0x3c2183(0x90),_0x5835cb,{'name':_0x3c2183(0xd7),'hash':_0x3c2183(0x68)},!![],[_0x3c2183(0xa8)]);}}return cache[_0x3c2183(0xb6)](_0x1137e5[_0x3c2183(0xf8)],_0x9c2bfa),_0x9c2bfa;}function onMessage(_0x5206a1,_0x39dc16){const _0x51ea13=_0x215b73;if(typeof console===_0x51ea13(0x106)){if(_0x51ea13(0xa6)!==_0x51ea13(0x89)){const _0x5f08b4=logHeader(_0x5206a1[_0x51ea13(0x64)])+('\\x20'+_0x39dc16[_0x51ea13(0x66)]),_0x585738=typeof console[_0x51ea13(0xe1)]===_0x51ea13(0xac);if(_0x585738){if(_0x51ea13(0x6e)===_0x51ea13(0x10b))return _0x3df388(new _0x2ff7e0());else console[_0x51ea13(0xe1)](_0x5f08b4);}else{if(_0x51ea13(0xfe)===_0x51ea13(0xb1)){const _0x33eea6=_0x397377[_0x51ea13(0xb5)]('.')[0x1],_0x21ea76=_0x269f1b[_0x51ea13(0x8e)](..._0x4b2edf(_0x33eea6));return _0x13ebb6[_0x51ea13(0xcb)](_0x21ea76);}else console[_0x51ea13(0x69)](_0x5f08b4);}console[_0x51ea13(0x69)](_0x5206a1[_0x51ea13(0xee)]);if(_0x585738){if(_0x51ea13(0xf2)!==_0x51ea13(0xf2))return new _0x3bca1c(_0x2dd628*0x3e8);else console[_0x51ea13(0xc2)]();}}else{const _0x1718ef=_0x420316^_0x2fab91;return _0x108a7e=_0x1b8201,_0x1718ef;}}}export{setScriptKey,validatePackage};\n","import * as licensing from '@progress/kendo-licensing';\nvar allowed = ['telerik.com', 'progress.com', 'stackblitz.io', 'csb.app'];\n/**\n * @hidden\n */\nexport function validatePackage(packageMetadata) {\n if (typeof licensing !== 'undefined') {\n licensing.validatePackage(packageMetadata);\n }\n else {\n var message = \"License activation failed for \".concat(packageMetadata.name, \"\\n\");\n message += 'The @progress/kendo-licensing script is not loaded.\\n';\n message += \"See \".concat(packageMetadata.licensingDocsUrl, \" for more information.\\n\");\n console.warn(message);\n }\n}\n/**\n * @hidden\n */\nexport function shouldShowValidationUI(packageMetadata) {\n var skip = allowed.some(function (hostname) { var _a; return (_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.location.hostname.endsWith(hostname); });\n return !skip && !(licensing === null || licensing === void 0 ? void 0 : licensing.validatePackage(packageMetadata));\n}\n","import { canUseDOM } from './canUseDOM';\n/** @hidden */\nexport var hasRelativeStackingContext = function (elementSource) {\n if (!canUseDOM) {\n return false;\n }\n // Component need to pass element to make sure document owner is correct.\n // This however might be performance hit if checked for example on each drag event.\n var currentDocument = elementSource ? elementSource.ownerDocument : document;\n if (!currentDocument || !currentDocument.body) {\n return false;\n }\n var top = 10;\n var parent = currentDocument.createElement('div');\n parent.style.transform = 'matrix(10, 0, 0, 10, 0, 0)';\n var child = currentDocument.createElement('div');\n child.appendChild(currentDocument.createTextNode('child'));\n child.style.position = 'fixed';\n child.style.top = top + 'px';\n parent.appendChild(child);\n currentDocument.body.appendChild(parent);\n var isDifferent = child.getBoundingClientRect().top !== top;\n currentDocument.body.removeChild(parent);\n return isDifferent;\n};\n","/* eslint-disable max-len */\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nvar licenseKeyUrl = 'https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-banner';\nvar didRender = false;\n/**\n *\n * @hidden\n */\nexport var WatermarkOverlay = function () {\n var _a = React.useState(true), isOpen = _a[0], setIsOpen = _a[1];\n var _b = React.useState(false), bannerMounted = _b[0], setBannerMounted = _b[1];\n React.useEffect(function () {\n if (!didRender) {\n setBannerMounted(true);\n didRender = true;\n }\n }, []);\n var onCloseBannerClick = function () {\n setIsOpen(false);\n };\n var bannerElement = (React.createElement(React.Fragment, null, isOpen && (React.createElement(\"div\", { style: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n position: 'fixed',\n top: '16px',\n right: '16px',\n padding: '12px',\n borderRadius: '4px',\n boxShadow: '0px 4px 5px 0px rgba(0, 0, 0, 0.04), 0px 2px 4px 0px rgba(0, 0, 0, 0.03)',\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '20px',\n backgroundColor: '#FFC000',\n color: '#1E1E1E',\n zIndex: 999\n } },\n React.createElement(\"span\", { style: { display: 'flex', alignSelf: 'center', marginRight: '8px' } },\n React.createElement(\"svg\", { width: \"16\", height: \"16\", viewBox: \"0 0 16 16\", fill: \"none\" },\n React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M8 1L0 15H16L8 1ZM7 6V11H9V6H7ZM7 14V12H9V14H7Z\", fill: \"#1E1E1E\" }))),\n React.createElement(\"span\", null, \"No valid license found for KendoReact. Learn how to activate your license.\"),\n React.createElement(\"div\", { style: { display: 'flex', alignItems: 'center', marginLeft: '24px' } },\n React.createElement(\"a\", { href: licenseKeyUrl, style: { marginRight: '8px', display: 'flex' } },\n React.createElement(\"button\", { title: 'Learn More', style: {\n display: 'inline-flex',\n position: 'relative',\n border: 'none',\n borderRadius: '4px',\n padding: '5px',\n backgroundColor: 'transparent',\n transition: 'color 0.2s ease-in-out',\n outline: 'none',\n cursor: 'pointer'\n } },\n React.createElement(\"svg\", { width: \"16\", height: \"16\", viewBox: \"0 0 16 16\", fill: \"none\" },\n React.createElement(\"path\", { d: \"M15 8C15 11.8656 11.8656 15 8 15C4.13437 15 1 11.8656 1 8C1 4.13437 4.13437 1 8 1C11.8656 1 15 4.13437 15 8ZM14 8C14 4.6875 11.3125 2 8 2C4.6875 2 2 4.6875 2 8C2 11.3125 4.6875 14 8 14C11.3125 14 14 11.3125 14 8ZM11 6C11 7.4125 10.2687 8.05937 9.73125 8.53125C9.25937 8.94688 9 9.17813 9 10H7C7 8.275 7.84688 7.525 8.40938 7.03125C8.84062 6.65312 9 6.50938 9 6C9 5.45 8.55 5 8 5C7.45 5 7 5.45 7 6H5C5 4.34375 6.34375 3 8 3C9.65625 3 11 4.34375 11 6ZM9 13V11H7V13H9Z\", fill: \"#1E1E1E\" })))),\n React.createElement(\"button\", { title: 'Close', style: {\n display: 'inline-flex',\n position: 'relative',\n border: 'none',\n borderRadius: '4px',\n padding: '5px',\n backgroundColor: 'transparent',\n transition: 'color 0.2s ease-in-out',\n outline: 'none',\n cursor: 'pointer'\n }, onClick: onCloseBannerClick },\n React.createElement(\"svg\", { width: \"16\", height: \"16\", viewBox: \"0 0 16 16\", fill: \"none\" },\n React.createElement(\"path\", { d: \"M13 4.41562L9.41563 8L13 11.5844L11.5844 13L8 9.41563L4.41562 13L3 11.5844L6.58437 8L3 4.41562L4.41562 3L8 6.58437L11.5844 3L13 4.41562Z\", fill: \"#1E1E1E\" }))))))));\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { style: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n opacity: 0.2,\n zIndex: 101,\n pointerEvents: 'none',\n backgroundImage: 'url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABVxSURBVHgB7Z3tVRtJE4WL9zgANgLLGRCCnAGOADmCxRGgDFAGYiOADKQMIAGO9J8ji42g37mjqlUjBgOanpn+uM85sjC2sKzbVd1dVV0tQgghhBBCCCGEEEIIKRPn3Gn1GAlJmmN1pP558J6OX9540ejh4WGlX09OTk7+EZIclXYXlY43+vVflY7PH3wd9c+AY/Wvvcb9/b0bjUYOz/hBQpICmh1oOPrEa6l/4rTR337AhIMgTSqtzg+0m8gnof7p0mD8EzmGhkFwJiR6np6e7luLL9Q/RTDTBzF+7wfWg2CxWOCHjYVET6XTdLPZrFuLL9Q/NeCkoVUQ4/d+6Ijev1yof1rAUVMvQgjJHebrSRu+CEmWo/O8hISgCjStKpgiGoDWed4AUP/hwGf++Pi4hQYyFHgDzBP3T7A8b0uo/zD4+sMBy1CwWKR/YjF+fS/Uv2di0t/eEAdBT0QnvlD/PolR/xoOgu4JUd7bFdS/e6I1foODoFuqz3M2mUziFF+of5dEb/xGwyAYCwmCVuPNYv5MqX94Yl75NWKD4PLyEm92KqQoqH9Y8Bnis0zC+A14LbxxVqiVCfUPh678plxNFYQe5pjRgAgpDAv4IOAHJyCEkDJoiPaeCyG5UA1oRIYWHNivSSbV0wLq/zbQXz+bS8kV/AeZJ35NCcYPqH8zvv4VS8kVFou8phTjB9T/NcVt+zgI9rjQDRwTgPrvKcn5v4CDYIfT/vtFiS/UHxRr/AYHwQ4t9DiVwihZ/+KN36ATKJsS9U+utr9r/EGQdQSUNFKa/geZkImQ/2rHlznnQDG7oX9b9Xwl5AUl6G9oLcSSxl8Q/p4P13YJIaQMisvzEkJ2lJjnJyQY3lnoJGfNUvP8oUhZf7c70s2eCG1wL7uhRJ0iQnCveiDIhzf7t/f9IvP8IUhJfx/b9rErUkvgRVPIE1fv6xrvbzweu7OzM3d7e4v3OhfSilT092HMJzCxF4u43eWctfFvt1uHu9nxXvF1CWmtroldfx9W+HVErINAjX+M65ngAPxnOAJ1AiMhrUjBCdD4Oya2QYBlPwx8vV47WwFg+a+XZbrz83NzANz/ByBmJ0Dj74lYBgECfrbnt6U/DB/vC7388L2rqyu8vzshwYjRCdD4e8YfBLidVgYA0X7M9jB8PGazmbu5ualnfiz9dSAsufwPTwz6+5jjp/H3CD5ofPB9343u9v3u6+U+0jyY7eEA8Hx3d4c/QjvvMyGdMZT+TeA9wBHR+DPHUn3T6bRe7uMxn89tn18v/TH7O17gQEheYM9vEX7M9hbsg/FbHED3/IPPSISQgNhyE0au+7x7PPtOQFcB3PMTMjTYf4cyRN3zL2DgMHgs/7XU99acgDIWEgUh9W/4uWMh8QKBvCh8qxSR7fmxt0eEv8kJ6MzP8/2REFL/g59bp/o0xsMAb6xAnBB5Yr+6D3X9KOpBxP/ACWA0jFnoEw+h9D/4mYd5/pGQeAlRLFK95tJy+35578PDQ+0E9LAPi3wixAUsFmKRT6I0DIIPzdJuf6R3i+UeZnsz/nqjPx47/fMpZ/54OVb/g5/BZi4pY4Pgo8s2d3CkF0Z/cXFRL/+Xy2W9BdBUH4/5JsBn9W94PZu5pI77QzMOjepiNp/j71hO//fv31sr7qmtfT73i3xWjnvAZHhH/4nquXrLwB2bueSJ27Vmvodhq4df4BmzvQb3IPxWl/zgRl/DwZA4GrhdYFUHfbHE1y0enXsJ2FLfCnggvjqBejDoTI8o38ocgJAscNq8BY4fv/Uf+J46gjkdQcbA+19fXzs7zQfR8TWcgH+kFw/u+fMDKz/o3OQETk9PLcWLPSBbeeWELd91eb+CcTc5gXr6r9J8PNKbF/7S3z+6DYcvDasBOv6M0GUduNDfv+cEYPhjIVmA+I3Vc4gaOQzfHAECvb4joAPICCzlrIJP93h/dAIYDBQ/L8wBNC37rXUblv5CB5AfGvi5h6F7Ed9GJ2CZP0b780O1vreVnnhOAFsBOoCMscg/HMBbTsCO+grJFkvvHmYCSnYA/5MMcbsiH6TykNgfr9fry58/f0oltFxcXMj379+l+h42gBcnJyfr6iXfq1nhJ56FZIeuAq+fn59Xv379Oq0CgVJNBEIydAAavLv98ePHeSX4bfX1OQSv9noQ/a7y9A8HTuAcTqB63FSPZyE5Mq3GwOW3b99kNpu9+5e/fv2Kp3+FpAW8vB3cwbLOOvZYfl9LfGdW9KOn+mZCskZXhCuL9vtLfjvshd97hWArpn8TxGn5rhZzOL/gB19DYBzzxcEeTQEtGfArB7c7xbmyVu4YExoTuNcYEL6eCkkTxHYOmna4wzQfvq8z/+o949e940hIkjTp5/ZXjm/1+VQfr856UP/EcLtqr9s/OQENDl5+wPhH3nHQZK6mJjucNvNo2w+A+icC0jaY4a2LT5MT+Mye3+l58JSupiY7XIA2XtQ/IZw2f7D9v+X6D53AZ/f8LqGrqckOF7CNF/VPAF3Or6xvv53r951Amx5+DYOAXWEjxXXQxov6R4zTSzusht8OfABE+r3U39y1iPbbIODVX3ED4/Tagk8kENQ/QiyaC1Fg7PX6frm0Mk6/wUOQ8l799+j9I0cDwcF1ov4R4Xbde2vjxi92ogsPzPrY92szD7buJiQn3K6+v17q2yxvlV1u3+TRAn4jIYTkAfbymOWx1AcwfHMEXp5/JISQ9PEDd867ohvGbvt+cwRe6+5ee7ltNpuVf7yYdA8+68fHxy0+exkY6t8RGnSxJX19yAd7fWvhjEs7NOCHb2D9/+AGqO3HQGSeuD/8PD/GggwM9e8IBPCwr7ciHnzA6NrqtW5+4QRkIByLRXrDRXhXH/XvCKRccEuPX8mHD9jr7Vc7AV32D9rJh4Oge2I0foP6d8QHnADO9kdxYw8HQXfEbPwG9e+It5yAlvdG1beNgyA8KRi/Qf07oskJIEYQw8x/SMMgGAs5CmR0UjF+g/oHwh00YzAn0OZgT1/YINBU5VTIUeCzw2eYivEb1L8l7o1mDm7X220a48x/iNtVLE4dC5OOxu2794wlMaj/kbgAzRwIIQmS4p6PEBKIp6enexo/IYWCPdNms1nnbPxat7BwvH/+P7Dt08/kUjKH+hcOxGeeeI8f86lYSuZQ/8JhsciehoBv9rMi9VdcwZcucBCkVeEXmuL1dy0vbciBkgdBycZvFKs/8/x7ShwENP49xelP8V9T0iBgncdritGfxv82/iDIORJ+EAGfCKnJXn8a//to7fgy51y45sCX1P812erPZR8hBVMZ/Ax9+2j8hBSIHumcpXikkxBCBsXtz8QnUyXndvfz8Sx8AFLUnwTEveyKE32KyAK+7IYThqT0V88/o+cPBz7TVPLEJdb2d00y+pv4elHHTEgwUigWYaq3O6LXn56/e2IeBDT+7olWf4rfHzEOAurfH9HpT/H7J6ZBQP37Jxr9Kf5w+IMAt9PKQOB6NurfP4Prjyg/jX9Y8JnDAHE/vQwE/m0MQOrfP4PqX/3jp15Dj4kQQspCK5SK7OZDCCGEEBIfbneH4kgCoT9vLCQJguqPaD8CDdXzlZDogaEuFotgKSLL9uBnYmAJiZqg+vupPlzbJSR6YKSh8sSODVyTI5j+LO9NlxDFIqzzSJfW+jPPnz4Ng+DDGRvqnz5t9GeePxNsEHx2+U798+BY/e3FzPNnwLE6Uv88oI6EEEIIIYQQQgghhBBCCCGEEEIIIYQQQkiRoHyQxz/T51gdqX8evKfjlzdeNHp4eFjp15OTk5N/hCQHjoFWOt7o139VOj5/8HXUPwOO1f+/02ApXEhJmmnTzIP6p49r28wlRFMJMgwhmnlQ/3RB854g/RwaBgF7wkVOyGYe1D9N0L4vWDMXGwTaFHIsJGpgpF5TyIm0hPqnR6XTdLPZrF2oZi7aVIDePxFgqCH1ov6EEEIIITHRtl7jixBCkuToPH8ocGMQrihmiqh/8Jnjau6hrwen/sPQOs8fAgxA5on7xxcfBigDQf2HIUSdR6g3wmKRnolGfKH+QxCT/vaGOAh6Ijrxhfr3SYz613AQdE+04gv174Ng5b1dwUHQHTEbv0H9u6X6PGeTySTu69oaBsFYSCui9/we1L87tBpzFv1naoPg8vISA2AqpBX4DPFZxm78BvUn9awF8R07yrRGPf80pdmU+hNCyJHoYa4ZHSghhWEBXwT84ASEEFIGDdmec8mJ6j+EyNAiu/9YACC+fjaXkinU/21SSPW2BuIzT/waX/yKpWQK9W+mCOMHLBZ5TfbLPg/q/5pijN/gINhTnPhC/X1cwAauScFBUKbxG9R/h9P7F0rTv6bkQVCy8Rt0Aju00OtUSqTEQZBSbX/X0AmQF4Mg5wi4cRAJn0jhlKY/aUBrx5c558ANzYUvafx7StAfqxv0UKyer4QQUg5+zAfXdgkhpAxKqvMghHgUm+cPhdufhU/Oa+qRTp6Jb0HK+oOi8/whcC+74SSTIrJlH7vitCMl/RHcqx4I8uHN/u19v9w8f1swi6aWJ+aeLxyp6F+9r2u8v/F47M7Oztzt7S3e61xIe1IqFmGFX3hi19/tLuesjX+73brFYlG/V3xdQlq7F1JwAjT+7ohVfzX+Ma5ngwPwn+EI1AmMhLQnZidA4++e2PTHsh8Gvl6vna0AsPzXy1Ld+fm5OQDu/0MRoxOg8fdHLPoj4Gd7flv6w/DxvtDLD9+7urrC+7sTEhZ/EOB2WhkYE57G3w8x6I9oP2Z7GD4es9nM3dzc1DM/lv46FpZc/ncEBgEMD7XVMjB4DxiINP7+GEp/t7/voF7uI0WJ2R4OAM93d3f4I7TzPhNCSD5Yqm86ndbLfTzm87nt8+ulP2Z/x+vQCMkL7Pktwo/Z3oJ9MH6LA+ief/AVKSEkILbdgJHr3v4ez74T0FUA9/wxgP1XF0Lozx0LiZqQ+uuefwEDh8Fj+a+lvrfmBJSxkOGBEF4UNliKyFJ9usdjgCdSQupve37s7RHhb3ICOvPzfH8swDhD54kb8vwjIVESSn+/ug91/SjqQcT/wAlgNhiz0CcyQhaLsMgnPULoX73m0nL7fnnvw8ND7QT0sA+LfGKlYRB82ks7NnNIlmP1d/sjvVtsJTDbm/HXG/3x2OmfTznzR44NgmOX7Y7NHJLms/q7gyO9MPqLi4t6+b9cLustgKb6eMw3FdwfmjFggKg3X71l4I7NHJLmHf3PVPs5/o7l9H///r214p7a2udzv8hn5RgDShsN3Czg1SE4lom6xKO4heB2rdnvYdi6QljgGbO9BvfgOLa65Ac3+hpOBinjtHkDhMdv/Qe+p45gTkeQL7bUtwIeaK5OoJ4MdKZHlG9lDkBIPsDzQ/QmJ3B6emopHqwB2corQzDDX19fOzvNh7GAr+EE/CO9eHDPnxH+0t8/ugnBpWE1QOHzwpbvurxfwbibnEA9/VdpPh7pzQjs3yyfK2rkMHxzBAj0+I6ADiAvdFsHLvT37zkBGP5YSB6YA2ha9lvrJiz9hQ4gO7CVswo+jfH80QlgMqD2GaKC35unF88JYCtAB5AnGvi9h6F7GZ9GJ2CZP0b7M8XSO4eZADqAvLHIPxzAW07AjvpKYfxPCkBngevn5+fVr1+/TqtAoFQDQUieuF2RD1J5SOyP1+v15c+fP6Vy9HJxcSHfv3+X6nsIAF2cnJysq5d8r1YAP/EshVGEA6iYVkZ/+e3bN5nNZu/+5a9fv+LpXyHJocG72x8/fpxXDv+2+vocDr+K9cDp31UrvYcDJ3AOJ1A9bqrHs5D80BlhZdF+f8lvhz3we68QZMX0T3pglWcHd6Cjdeyx/L6W+M6s6EdP9c2ElIHbneJaWStnFIRoTOBe94D4eiokSZyW72oxl/MLfvA1jB6642CPpoCXDPhljO79RwffG6kj2OrzqT5e1Xo3vZ7EC2K7B0073GGaD9/XmX/1nvFT/4Rx2syjbT+AIW+gIZ/D7ao9b//kBDQ4ePkB46f+qeICtPFy2g8gpavJSwZpW8zw1sWnyQl8Zs9P/RPFBWzj5RK6mrxkTCfb/1uu/9AJfHbPT/0Tw3XQxqthELArcETocn5lffvtXL/vBNr08KP+CQFxvLbQEwmEDQJe/RQXTi/tsBp+O/AFEOn3Un9z1yLaT/0TQgNBwb20Zg/o/SPBsjkwShh7vb5fLq2M22/wEqS8V/+9sRBChsXtuvfWxo1f7EQnHpj1se/XZh5s3U1ITrhdfX+91LdZ3io73b7JqwX8RkIIyQPs5THLY6kPYPjmCLw8/0hI3iAd8/j4uN1sNisZGLwH/3gpCYcfuHPeFd0wdtv3myPwWnf32suR+veMn+fHBy8DA0fEPHF4NOhmS/r6kA/2+tbCHZd2aMAP38D6/8ENUNtP/XvERXhXn2OxSCcggId9vRXx4LNF12avdfsLJyADQf17IkbjNzgIwoOUK27p8Sv58Nl6vf1qJ6DL/kE7+VD/jonZ+A0OgvB8wAngbH8UN/ZQ/45IwfgNDoLwvOUEtLw3qr6N1D8wiOimYvxGwyAYC2lFkxNAjCCGmf8Q6h8QRHeR7knF+A0bBJqqmgr5NO6gGYc5gTYHe/qC+gfC7bv3jCUx3K5ibepYmPJp3BvNXNyut+M0xpn/EOpPyBG4AM1cCCEJkmLMhxASiKenp3saf4Fg2Vc9FsjpSuZo3hr/115r1lMAe+bNZrPO2fip/wH+nq9iKZkD8ZknLhfq79EQ8MneK7JYpGyov5JShV9oOAjKvnSjeP1LNn6j5EHgWl7akgPF6k/j31PiIGCef09x+jPP+5qSBgGd/2uKcgIHEdCJkBp/EOSaCaHxv00J+tdoDnRJ8V+jtePLHGshaPzvk7P+pGC47SOkYCqDn6FvH42fkAJxuyPdaN01FlIGbnc/37TkFE8o3L4nAmvHCyQ5/S3gw24oYXAvuyKxbLgwktK/xNr+rsFqKpU8sa78Zlz5hSMZ/Znq6Y4UikVMf72oYyYkGNHrT+PvnpgHAVd+3ROt/jT+/ohxEFD//ohOf4rfPzENAurfP1E5AVzPRPH7xx8EuJ1WBoDGPxyH+ruhjlTjbnR9AxMhvYLPHA4YGkjPIMpP4x+WIfUnhYMZx2voMRFCSFlohVqR3XwIIaQc3O5OtrGQJFC9RkKKRCsyRxICi/YuFgvs986ERA3Eh1ahUkT4GQg0Vc9XQqInqP6ODRyTA046VJ7Y1x/XdgmJnmD6M8+bLiGKRVjemy6t9WeeN30aBsGHI/bUP33a6M88bybYIPjs9o3658Gx+tuLmefNgGN1pP55QB0JIYQQQgghhBBCCJGy+T9ftRg+rVNPfAAAAABJRU5ErkJggg==\\')'\n } }),\n bannerMounted && ReactDOM.createPortal(bannerElement, document.body)));\n};\n","/**\n * @hidden\n * Dispatches a new event based on an event that was already internally dispatched to KendoReact users.\n *\n * @param eventHandler - The public event handler that is assigned by the user.\n * When undefined, the method is not an option.\n * @param dispatchedEvent - The event that was already dispatched internally.\n * @param target - The target component of the new event.\n * @param eventData - The additional data that will be passed through the new event.\n * When the new event has no additional data\n * other than the `BaseEvent` arguments, pass `undefined`.\n */\nexport function dispatchEvent(eventHandler, dispatchedEvent, target, eventData) {\n if (eventHandler) {\n var eventBaseData = {\n syntheticEvent: dispatchedEvent,\n nativeEvent: dispatchedEvent.nativeEvent,\n target: target\n };\n eventHandler.call(undefined, Object.assign(eventBaseData, eventData));\n }\n}\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport * as React from 'react';\n/**\n * An utility function for asynchronous focus/blur handling.\n *\n * By default, the `onFocus` and `onBlur` callbacks are called every time a child components receives/loses focus.\n * Use this utility hook for scenarios where you need to know if the parent has received focus for the first time, or completely lost focus.\n *\n * @returns\n */\nexport function useAsyncFocusBlur(_a) {\n var onFocus = _a.onFocus, onBlur = _a.onBlur, onSyncFocus = _a.onSyncFocus, onSyncBlur = _a.onSyncBlur;\n var focused = React.useRef(false);\n var tick = React.useRef(0);\n var nextTick = React.useCallback(function (f) {\n clearTimeout(tick.current);\n tick.current = window.setTimeout(function () { return f(); });\n }, [tick]);\n var handleFocus = React.useCallback(function () {\n var event = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n event[_i] = arguments[_i];\n }\n clearTimeout(tick.current);\n if (onSyncFocus) {\n onSyncFocus.call(undefined, event[0]);\n }\n if (focused.current) {\n return;\n }\n ;\n focused.current = true;\n if (onFocus) {\n onFocus.call.apply(onFocus, __spreadArray([undefined], event, false));\n }\n }, [focused, onFocus, onSyncFocus]);\n var handleBlur = React.useCallback(function () {\n var event = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n event[_i] = arguments[_i];\n }\n if (onSyncBlur) {\n onSyncBlur.call(undefined, event[0]);\n }\n nextTick(function () {\n if (!focused.current) {\n return;\n }\n if (onBlur) {\n focused.current = false;\n onBlur.call.apply(onBlur, __spreadArray([undefined], event, false));\n }\n });\n }, [focused, nextTick, onBlur, onSyncBlur]);\n React.useEffect(function () {\n return function () {\n clearTimeout(tick.current);\n };\n }, []);\n return {\n onFocus: handleFocus,\n onBlur: handleBlur\n };\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { useAsyncFocusBlur } from '../hooks/useAsyncFocusBlur';\n/**\n * An utility High-order Component for asynchronous focus/blur handling.\n *\n * By default, the `onFocus` and `onBlur` callbacks are called every time a child components receives/loses focus.\n * Use this utility HOC for scenarios where you need to know if the parent has received focus for the first time, or completely lost focus.\n *\n * @returns\n */\nexport var AsyncFocusBlur = function (_a) {\n var children = _a.children, onFocus = _a.onFocus, onBlur = _a.onBlur, onSyncFocus = _a.onSyncFocus, onSyncBlur = _a.onSyncBlur;\n var args = useAsyncFocusBlur({ onFocus: onFocus, onBlur: onBlur, onSyncFocus: onSyncFocus, onSyncBlur: onSyncBlur });\n return React.createElement(React.Fragment, null, children.call(undefined, __assign({}, args)));\n};\n","import * as React from 'react';\n/** @hidden */\nexport var usePropsContext = function (context, props) {\n var contextPropsCallback = React.useContext(context);\n var contextProps = contextPropsCallback(props);\n return contextProps;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { usePropsContext } from '../hooks/usePropsContext';\n/** @hidden */\nexport var createPropsContext = function () { return React.createContext(function (props) { return props; }); };\n/** @hidden */\nexport var withPropsContext = function (context, Component\n// eslint-disable-next-line react/display-name\n) { return React.forwardRef(function (props, ref) {\n var contextProps = usePropsContext(context, props);\n return (React.createElement(Component, __assign({}, contextProps, { ref: ref })));\n}); };\n","import * as React from 'react';\n/**\n * @hidden\n */\nexport function useDir(elementRef, initialDir, args) {\n // Dir prop is read only on initial rendering due to specifics of getComputedStyles - see below\n var _a = React.useState(initialDir), dir = _a[0], setDir = _a[1];\n React.useEffect(function () {\n if (!dir && window && elementRef.current) {\n // Note: getComputedStyle forces reflow\n var rtlCandidate = window.getComputedStyle(elementRef.current).direction;\n if (rtlCandidate) {\n // rerender is needed as DOM is read after first render\n setDir(rtlCandidate);\n }\n }\n }, args);\n return dir;\n}\n","import * as React from 'react';\n// Same as 'useDir'. Export to avoid breaking change.\n// 'useRtl' is incorrect naming, since applies that the returned value is `true` or `false`.\n// but instead, it is returning `ltr` or `rtl`.\n/**\n * @hidden\n */\nexport function useRtl(elementRef, initialDir, args) {\n // Dir prop is read only on initial rendering due to specifics of getComputedStyles - see below\n var _a = React.useState(initialDir), dir = _a[0], setDir = _a[1];\n React.useEffect(function () {\n if (!dir && window && elementRef.current) {\n // Note: getComputedStyle forces reflow\n var rtlCandidate = window.getComputedStyle(elementRef.current).direction;\n if (rtlCandidate) {\n // rerender is needed as DOM is read after first render\n setDir(rtlCandidate);\n }\n }\n }, args);\n return dir;\n}\n","import * as React from 'react';\n/**\n * @hidden\n */\nexport var useMouse = function (props, target, extend) {\n if (extend === void 0) { extend = {}; }\n var handleMouseDown = React.useCallback(function (event) {\n if (extend.onMouseDown) {\n extend.onMouseDown.call(undefined, event);\n }\n if (props.onMouseDown) {\n props.onMouseDown.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseDown, props.onMouseDown, target]);\n var handleMouseUp = React.useCallback(function (event) {\n if (extend.onMouseUp) {\n extend.onMouseUp.call(undefined, event);\n }\n if (props.onMouseUp) {\n props.onMouseUp.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseUp, props.onMouseUp, target]);\n var handleClick = React.useCallback(function (event) {\n if (extend.onClick) {\n extend.onClick.call(undefined, event);\n }\n if (props.onClick) {\n props.onClick.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onClick, props.onClick, target]);\n var handleDoubleClick = React.useCallback(function (event) {\n if (extend.onDoubleClick) {\n extend.onDoubleClick.call(undefined, event);\n }\n if (props.onDoubleClick) {\n props.onDoubleClick.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onDoubleClick, props.onDoubleClick, target]);\n var handleMouseEnter = React.useCallback(function (event) {\n if (extend.onMouseEnter) {\n extend.onMouseEnter.call(undefined, event);\n }\n if (props.onMouseEnter) {\n props.onMouseEnter.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseEnter, props.onMouseEnter, target]);\n var handleMouseLeave = React.useCallback(function (event) {\n if (extend.onMouseLeave) {\n extend.onMouseLeave.call(undefined, event);\n }\n if (props.onMouseLeave) {\n props.onMouseLeave.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseLeave, props.onMouseLeave, target]);\n var handelMouseMove = React.useCallback(function (event) {\n if (extend.onMouseMove) {\n extend.onMouseMove.call(undefined, event);\n }\n if (props.onMouseMove) {\n props.onMouseMove.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseMove, props.onMouseMove, target]);\n var handleMouseOut = React.useCallback(function (event) {\n if (extend.onMouseOut) {\n extend.onMouseOut.call(undefined, event);\n }\n if (props.onMouseOut) {\n props.onMouseOut.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseOut, props.onMouseOut, target]);\n var handleMouseOver = React.useCallback(function (event) {\n if (extend.onMouseOver) {\n extend.onMouseOver.call(undefined, event);\n }\n if (props.onMouseOver) {\n props.onMouseOver.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [extend.onMouseOver, props.onMouseOver, target]);\n return {\n onClick: handleClick,\n onMouseUp: handleMouseUp,\n onMouseDown: handleMouseDown,\n onDoubleClick: handleDoubleClick,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onMouseMove: handelMouseMove,\n onMouseOut: handleMouseOut,\n onMouseOver: handleMouseOver\n };\n};\n","/**\n * @hidden\n */\nexport var useCustomComponent = function (comp) {\n /* if(React.isValidElement

(comp)) {\n return [comp.type, comp.props];\n } */\n return [comp, {}];\n};\n","import * as React from 'react';\n/**\n * Returns a function, which gets the `ownerDocument` of the element.\n */\nexport var useDocument = function (ref) {\n var getElement = React.useCallback(function () { return ref.current && ref.current.element\n ? ref.current.element\n : ref.current; }, [ref]);\n var getDocument = React.useCallback(function () {\n var element = getElement();\n return element ? element.ownerDocument || document : document;\n }, [getElement]);\n return getDocument;\n};\n","/**\n * @hidden\n */\nexport var SIZE_CLASSES = {\n 'default': '',\n 'xsmall': 'k-icon-xs',\n 'small': 'k-icon-sm',\n 'medium': 'k-icon-md',\n 'large': 'k-icon-lg',\n 'xlarge': 'k-icon-xl',\n 'xxlarge': 'k-icon-xxl',\n 'xxxlarge': 'k-icon-xxxl'\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '../classNames';\nimport { SIZE_CLASSES } from './constants';\nimport { toIconClass, useMouse } from '../main';\n/**\n * Represents the [KendoReact Icon component]({% slug overview_icon %}).\n *\n * @example\n * ```jsx\n * const App = () => {\n * return (\n * \n * );\n * };\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var Icon = React.forwardRef(function (props, ref) {\n var className = props.className, name = props.name, themeColor = props.themeColor, size = props.size, flip = props.flip, style = props.style, id = props.id, tabIndex = props.tabIndex, others = __rest(props, [\"className\", \"name\", \"themeColor\", \"size\", \"flip\", \"style\", \"id\", \"tabIndex\"]);\n var target = React.useRef(null);\n var elementRef = React.useRef(null);\n React.useImperativeHandle(target, function () { return ({\n element: elementRef.current\n }); });\n React.useImperativeHandle(ref, function () { return target.current; });\n var sizeProp = React.useMemo(function () { return size || defaultProps.size; }, [size]);\n var flipProp = React.useMemo(function () { return flip || defaultProps.flip; }, [flip]);\n var fontClassNames = React.useMemo(function () {\n var _a;\n return classNames('k-icon', 'k-font-icon', name && toIconClass(name), (_a = {},\n _a[\"k-color-\".concat(themeColor)] = themeColor,\n _a['k-flip-h'] = flipProp === 'horizontal' || flipProp === 'both',\n _a['k-flip-v'] = flipProp === 'vertical' || flipProp === 'both',\n _a), SIZE_CLASSES[sizeProp], className);\n }, [name, themeColor, sizeProp, flipProp, className]);\n var mouseProps = useMouse(props, target);\n return (React.createElement(\"span\", __assign({ ref: elementRef }, others, mouseProps, { className: fontClassNames, id: id, tabIndex: tabIndex, style: style, role: \"presentation\" })));\n});\nIcon.propTypes = {\n style: PropTypes.object,\n classNames: PropTypes.string,\n name: PropTypes.string,\n themeColor: PropTypes.oneOf([\n 'inherit', 'primary', 'secondary', 'tertiary',\n 'info', 'success', 'error', 'warning',\n 'dark', 'light', 'inverse'\n ]),\n size: PropTypes.oneOf(['default', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'xxxlarge']),\n flip: PropTypes.oneOf(['default', 'horizontal', 'vertical', 'both'])\n};\nvar defaultProps = {\n size: 'default',\n flip: 'default'\n};\nIcon.displayName = 'KendoIcon';\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '../classNames';\nimport { SIZE_CLASSES } from './constants';\n/**\n * Represents the [KendoReact SvgIcon component]({% slug overview_svgicon %}).\n *\n * @example\n * ```jsx\n * import { accessibility } from '@progress/kendo-svg-icons';\n *\n * const App = () => {\n * return (\n * \n * );\n * };\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var SvgIcon = React.forwardRef(function (props, ref) {\n var children = props.children, className = props.className, svgClassName = props.svgClassName, icon = props.icon, flip = props.flip, id = props.id, tabIndex = props.tabIndex, size = props.size, style = props.style, svgStyle = props.svgStyle, themeColor = props.themeColor, viewBox = props.viewBox, name = props.name, onClick = props.onClick, others = __rest(props, [\"children\", \"className\", \"svgClassName\", \"icon\", \"flip\", \"id\", \"tabIndex\", \"size\", \"style\", \"svgStyle\", \"themeColor\", \"viewBox\", \"name\", \"onClick\"]);\n var elementRef = React.useRef(null);\n React.useImperativeHandle(ref, function () { return ({\n element: elementRef.current\n }); });\n var iconNameProp = React.useMemo(function () { return icon ? icon.name : defaultProps.icon; }, [icon]);\n var sizeProp = React.useMemo(function () { return size || defaultProps.size; }, [size]);\n var flipProp = React.useMemo(function () { return flip || defaultProps.flip; }, [flip]);\n var viewBoxProp = React.useMemo(function () { return viewBox || defaultProps.viewBox; }, [viewBox]);\n var elementClassNames = React.useMemo(function () {\n var _a;\n return classNames('k-icon', 'k-svg-icon', 'k-svg-i-' + iconNameProp, (_a = {},\n _a[\"k-color-\".concat(themeColor)] = themeColor,\n _a['k-flip-h'] = flipProp === 'horizontal' || flipProp === 'both',\n _a['k-flip-v'] = flipProp === 'vertical' || flipProp === 'both',\n _a), SIZE_CLASSES[sizeProp], className);\n }, [iconNameProp, themeColor, sizeProp, flipProp, className]);\n var elementStyle = React.useMemo(function () {\n if (props.width && props.height) {\n return __assign({ width: props.width, height: props.height }, style);\n }\n else if (props.width) {\n return __assign({ width: props.width, height: props.width }, style);\n }\n else if (props.height) {\n return __assign({ width: props.height, height: props.height }, style);\n }\n else {\n return __assign({}, style);\n }\n }, [props.width, props.height, style]);\n return (React.createElement(\"span\", { className: elementClassNames, style: elementStyle, ref: elementRef, onClick: onClick },\n React.createElement(\"svg\", __assign({ id: id, className: svgClassName, style: svgStyle, \"aria-hidden\": true, tabIndex: tabIndex, focusable: false, xmlns: \"http://www.w3.org/2000/svg\", viewBox: icon ? icon.viewBox : viewBoxProp, dangerouslySetInnerHTML: icon ? { __html: icon.content } : undefined }, others), icon ? undefined : children)));\n});\nSvgIcon.propTypes = {\n style: PropTypes.object,\n classNames: PropTypes.string,\n children: PropTypes.any,\n icon: PropTypes.object,\n themeColor: PropTypes.oneOf([\n 'inherit', 'primary', 'secondary', 'tertiary',\n 'info', 'success', 'error', 'warning',\n 'dark', 'light', 'inverse'\n ]),\n size: PropTypes.oneOf(['default', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'xxxlarge']),\n flip: PropTypes.oneOf(['default', 'horizontal', 'vertical', 'both'])\n};\nvar defaultProps = {\n size: 'default',\n flip: 'default',\n icon: '',\n viewBox: '0 0 24 24'\n};\nSvgIcon.displayName = 'KendoSvgIcon';\n","import * as React from 'react';\n;\n/**\n * Represents a React Context which provides you with the option to configure the KendoReact components icons.\n */\nexport var IconsContext = React.createContext({ type: 'svg' });\nIconsContext.displayName = 'KendoReactIconsContext';\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { Icon } from './Icon';\nimport { SvgIcon } from './SvgIcon';\nimport { IconsContext } from './IconsContext';\n/**\n * @hidden\n */\nexport var IconWrap = React.forwardRef(function (props, ref) {\n var _a, _b;\n var _c = React.useContext(IconsContext), type = _c.type, icons = _c.icons;\n var icon = props.icon, fontIconProps = __rest(props, [\"icon\"]);\n var name = type === 'svg' ? (((_a = props.icon) === null || _a === void 0 ? void 0 : _a.name) || props.name) : (props.name || ((_b = props.icon) === null || _b === void 0 ? void 0 : _b.name));\n name = (name && icons && icons[name] && typeof icons[name] === 'string') ? icons[name] : name;\n var svg = (name && icons && icons[name] && typeof icons[name] !== 'string') ? icons[name] : icon;\n return (type === 'svg' && svg) ?\n React.createElement(SvgIcon, __assign({}, props, { icon: svg, ref: ref })) :\n React.createElement(Icon, __assign({}, fontIconProps, { name: name, ref: ref }));\n});\nIconWrap.displayName = 'KendoIconWrap';\n","import * as PropTypes from 'prop-types';\n/**\n * @hidden\n */\nexport var toIconName = function (iconClass) { return iconClass.replace(/^k-i-/, ''); };\n/**\n * @hidden\n */\nexport var toIconClass = function (name) { return 'k-i-' + name; };\n/**\n * @hidden\n */\nexport var svgIconPropType = PropTypes.shape({\n name: PropTypes.string.isRequired,\n content: PropTypes.string.isRequired,\n viewBox: PropTypes.string.isRequired\n});\n","var getRatio = function (element, target) {\n var elementRect = element.getBoundingClientRect();\n var targetRect = target.getBoundingClientRect();\n var top = Math.max(targetRect.top, elementRect.top);\n var left = Math.max(targetRect.left, elementRect.left);\n var right = Math.min(targetRect.left + targetRect.width, elementRect.left + elementRect.width);\n var bottom = Math.min(targetRect.top + targetRect.height, elementRect.top + elementRect.height);\n var width = right - left;\n var height = bottom - top;\n if (left < right && top < bottom) {\n var targetArea = targetRect.width * targetRect.height;\n var entryArea = elementRect.width * elementRect.height;\n var intersectionArea = width * height;\n var intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);\n return Number(intersectionRatio.toFixed(4));\n }\n return 0;\n};\n/** @hidden */\nexport var intersect = function (element, candidates) {\n var max = 0;\n var result = null;\n candidates.forEach(function (candidate) {\n if (candidate && element) {\n var ration = getRatio(element, candidate);\n if (ration > max) {\n max = ration;\n result = candidate;\n }\n }\n });\n return result;\n};\n","var detectBrowser = function () {\n var ua = window && window.navigator.userAgent;\n if (!ua) {\n return false;\n }\n var browser = false;\n var match = [];\n var browserRxs = {\n edge: /(edge)[ \\/]([\\w.]+)/i,\n webkit: /(chrome|crios)[ \\/]([\\w.]+)/i,\n safari: /(webkit)[ \\/]([\\w.]+)/i,\n opera: /(opera)(?:.*version|)[ \\/]([\\w.]+)/i,\n msie: /(msie\\s|trident.*? rv:)([\\w.]+)/i,\n mozilla: /(mozilla)(?:.*? rv:([\\w.]+)|)/i\n };\n for (var agent in browserRxs) {\n if (browserRxs.hasOwnProperty(agent)) {\n match = ua.match(browserRxs[agent]);\n if (match) {\n browser = {};\n browser[agent] = true;\n browser[match[1].toLowerCase().split(\" \")[0].split(\"/\")[0]] = true;\n browser.version = parseInt(document.DOCUMENT_NODE || match[2], 10);\n break;\n }\n }\n }\n return browser;\n};\n/** @hidden */\nexport var getDocument = function (element) {\n return element ? element.ownerDocument || window.document : window.document;\n};\n/** @hidden */\nexport var getWindow = function (element) {\n var document = getDocument(element);\n return document\n ? document.defaultView || window\n : window;\n};\n/** @hidden */\nexport var scrollableRoot = function (element) {\n var support = { browser: detectBrowser() };\n var document = getDocument(element);\n return (support.browser.edge || support.browser.safari) ? document.body : document.documentElement;\n};\n/** @hidden */\nexport var isScrollable = function (el) {\n if (el && el.className && typeof (el.className) === 'string' && el.className.indexOf('k-auto-scrollable') > -1) {\n return true;\n }\n var overflow = window.getComputedStyle(el, 'overflow').overflow;\n return overflow.indexOf('auto') > -1 || overflow.indexOf('scroll') > -1;\n};\n/** @hidden */\nexport var getScrollableParent = function (el) {\n var root = scrollableRoot(el);\n if (!el || el === document.body || el === document.documentElement) {\n return root;\n }\n var parent = el;\n while (parent\n && parent !== document.body\n && parent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE\n && parent.nodeType !== Node.DOCUMENT_NODE\n && !isScrollable(parent)) {\n parent = parent.parentNode;\n }\n if (parent && (parent === document.body || parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE)) {\n return root;\n }\n return parent;\n};\n/** @hidden */\nexport var autoScrollVelocity = function (mouseX, mouseY, rect) {\n var velocity = { x: 0, y: 0 };\n var AUTO_SCROLL_AREA = 50;\n if (mouseX - rect.left < AUTO_SCROLL_AREA) {\n velocity.x = -(AUTO_SCROLL_AREA - (mouseX - rect.left));\n }\n else if (rect.right - mouseX < AUTO_SCROLL_AREA) {\n velocity.x = AUTO_SCROLL_AREA - (rect.right - mouseX);\n }\n if (mouseY - rect.top < AUTO_SCROLL_AREA) {\n velocity.y = -(AUTO_SCROLL_AREA - (mouseY - rect.top));\n }\n else if (rect.bottom - mouseY < AUTO_SCROLL_AREA) {\n velocity.y = AUTO_SCROLL_AREA - (rect.bottom - mouseY);\n }\n return velocity;\n};\n/** @hidden */\nexport var scrollableViewPort = function (el, window) {\n var root = scrollableRoot(el);\n if (el === root) {\n return {\n top: root.scrollTop,\n left: root.scrollLeft,\n bottom: root.scrollTop + window.innerHeight,\n right: root.scrollLeft + window.innerWidth\n };\n }\n else {\n var rect = el.getBoundingClientRect();\n return {\n bottom: rect.top + rect.height,\n right: rect.left + rect.width,\n left: rect.left,\n top: rect.top\n };\n }\n};\n/** @hidden */\nexport var isPointerInsideContainer = function (x, y, container) {\n var rect = container.getBoundingClientRect();\n return (rect.top <= y &&\n rect.left <= x &&\n y <= rect.bottom &&\n x <= rect.right);\n};\n","import { intersect } from \"./algorithms\";\nimport { getWindow, autoScrollVelocity, scrollableViewPort, getScrollableParent, isPointerInsideContainer, getDocument } from \"./utils\";\n/** @hidden */\nexport var DRAG_AND_DROP_DISPATCH_ACTION;\n(function (DRAG_AND_DROP_DISPATCH_ACTION) {\n DRAG_AND_DROP_DISPATCH_ACTION[\"POINTER_DOWN\"] = \"pointerdown\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"POINTER_MOVE\"] = \"pointermove\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"POINTER_UP\"] = \"pointerup\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"POINTER_CANCEL\"] = \"pointercancel\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"MOUSE_DOWN\"] = \"mousedown\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"MOUSE_MOVE\"] = \"mousemove\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"MOUSE_UP\"] = \"mouseup\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"CONTEXT_MENU\"] = \"contextmenu\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"TOUCH_START\"] = \"touchstart\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"TOUCH_MOVE\"] = \"touchmove\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"TOUCH_END\"] = \"touchend\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"TOUCH_CANCEL\"] = \"touchcancel\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"SCROLL\"] = \"scroll\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"START\"] = \"KENDO_DRAG_AND_DROP_START\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"MOVE\"] = \"KENDO_DRAG_AND_DROP_MOVE\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"END\"] = \"KENDO_DRAG_AND_DROP_END\";\n DRAG_AND_DROP_DISPATCH_ACTION[\"CANCEL\"] = \"KENDO_DRAG_AND_DROP_CANCEL\";\n})(DRAG_AND_DROP_DISPATCH_ACTION || (DRAG_AND_DROP_DISPATCH_ACTION = {}));\nvar isTouchEvent = function (event) { return /^touch/.test(event.type); };\nvar isScrollEvent = function (event) { return /^(scroll)/.test(event.type); };\n/** @hidden */\nexport var normalizeEvent = function (event, state) { return (isTouchEvent(event)\n ? ({\n pageX: event.changedTouches[0].pageX,\n pageY: event.changedTouches[0].pageY,\n clientX: event.changedTouches[0].clientX,\n clientY: event.changedTouches[0].clientY,\n scrollX: state.scrollOffset.x,\n scrollY: state.scrollOffset.y,\n offsetX: state.offset.x,\n offsetY: state.offset.y,\n type: event.type,\n originalEvent: event,\n isTouch: true,\n altKey: false,\n ctrlKey: false,\n shiftKey: false,\n metaKey: false\n })\n : isScrollEvent(event)\n ? ({\n pageX: state.pageOffset.x,\n pageY: state.pageOffset.y,\n clientX: state.clientOffset.x,\n clientY: state.clientOffset.y,\n scrollX: state.scrollOffset.x,\n scrollY: state.scrollOffset.y,\n offsetX: state.offset.x,\n offsetY: state.offset.y,\n type: event.type,\n originalEvent: event,\n altKey: false,\n ctrlKey: false,\n shiftKey: false,\n metaKey: false\n })\n : ({\n pageX: event.pageX,\n pageY: event.pageY,\n clientX: event.clientX,\n clientY: event.clientY,\n offsetX: event.offsetX,\n offsetY: event.offsetY,\n scrollX: state.scrollOffset.x,\n scrollY: state.scrollOffset.y,\n type: event.type,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n altKey: event.altKey,\n metaKey: event.metaKey,\n originalEvent: event\n })); };\nvar noop = function () { };\n/** @hidden */\nexport var dispatchDragAndDrop = function (state, action, callbacks) {\n if (callbacks === void 0) { callbacks = {}; }\n var _a = callbacks.onIsPressedChange, onIsPressedChange = _a === void 0 ? noop : _a, _b = callbacks.onIsScrollingChange, onIsScrollingChange = _b === void 0 ? noop : _b, _c = callbacks.onVelocityChange, onVelocityChange = _c === void 0 ? noop : _c, _d = callbacks.onOffsetChange, onOffsetChange = _d === void 0 ? noop : _d, _e = callbacks.onPageOffsetChange, onPageOffsetChange = _e === void 0 ? noop : _e, _f = callbacks.onClientOffsetChange, onClientOffsetChange = _f === void 0 ? noop : _f, _g = callbacks.onScrollOffsetChange, onScrollOffsetChange = _g === void 0 ? noop : _g, _h = callbacks.onInitialScrollOffsetChange, onInitialScrollOffsetChange = _h === void 0 ? noop : _h;\n var drag = action.payload;\n var element = drag.element;\n var hint = drag.hint;\n var autoScrollDirection = state.autoScrollDirection;\n var overrideScrollableParent = state.scrollableParent;\n var event = normalizeEvent(action.event, state);\n switch (event.type) {\n case DRAG_AND_DROP_DISPATCH_ACTION.POINTER_DOWN:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.POINTER_DOWN\n && (!event.originalEvent.isPrimary\n || event.originalEvent.button !== 0)) {\n break;\n }\n // In rare cases where the `which` attribute is available in the mouse event\n // we check if the `left button` is explicitly clicked:\n // https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which#return_value\n case DRAG_AND_DROP_DISPATCH_ACTION.MOUSE_DOWN:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.MOUSE_DOWN\n && (event.originalEvent.which\n && event.originalEvent.which > 1)\n || state.ignoreMouse) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_START:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_START\n && event.originalEvent.touches.length !== 1) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.START: {\n var scrollableParent_1 = overrideScrollableParent || getScrollableParent(action.payload.element);\n onInitialScrollOffsetChange(scrollableParent_1 instanceof Window\n ? { x: scrollableParent_1.scrollX, y: scrollableParent_1.scrollY }\n : { x: scrollableParent_1.scrollLeft, y: scrollableParent_1.scrollTop });\n onClientOffsetChange({\n x: event.clientX,\n y: event.clientY\n });\n onPageOffsetChange({\n x: event.pageX,\n y: event.pageY\n });\n onOffsetChange({\n x: event.offsetX,\n y: event.offsetY\n });\n onIsPressedChange(true);\n if (drag.onPress) {\n drag.onPress(event);\n }\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.SCROLL:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.SCROLL && !state.pressed) {\n break;\n }\n var scrollableParent = overrideScrollableParent || getScrollableParent(element);\n var scrollOffset = scrollableParent instanceof Window\n ? { x: scrollableParent.scrollX, y: scrollableParent.scrollY }\n : { x: scrollableParent.scrollLeft, y: scrollableParent.scrollTop };\n event.scrollX = scrollOffset.x - state.initialScrollOffset.x;\n event.scrollY = scrollOffset.y - state.initialScrollOffset.y;\n onScrollOffsetChange({\n x: event.scrollX,\n y: event.scrollY\n });\n case DRAG_AND_DROP_DISPATCH_ACTION.POINTER_MOVE:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.POINTER_MOVE && !event.originalEvent.isPrimary) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.MOUSE_MOVE:\n case DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_MOVE:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_MOVE && event.originalEvent.touches.length !== 1) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.MOVE: {\n if (state.pressed) {\n if (state.autoScroll && event.originalEvent.type !== 'scroll') {\n if (element) {\n var document_1 = getDocument(element);\n var scrollableParent_2 = overrideScrollableParent || getScrollableParent(document_1.elementFromPoint(event.clientX, event.clientY));\n var newVelocity = autoScrollVelocity(event.clientX, event.clientY, scrollableViewPort(scrollableParent_2, getWindow(element)));\n onVelocityChange({\n x: (autoScrollDirection && autoScrollDirection.horizontal === false) ? 0 : newVelocity.x,\n y: (autoScrollDirection && autoScrollDirection.vertical === false) ? 0 : newVelocity.y\n });\n onIsScrollingChange(newVelocity.y !== 0 || newVelocity.x !== 0);\n }\n }\n if (!state.drag && drag.onDragStart) {\n drag.onDragStart(event);\n }\n if (drag.onDrag) {\n drag.onDrag(event);\n }\n var dropElement_1 = intersect(hint || element, state.drops.map(function (drop) { return drop && drop.element; }).filter(function (d) { return d !== (hint || element); }));\n var drop = state.drops.find(function (drop) { return drop.element === dropElement_1; });\n if (drop\n && dropElement_1\n && isPointerInsideContainer(event.clientX, event.clientY, overrideScrollableParent || getScrollableParent(dropElement_1))\n && dropElement_1 !== element) {\n if ((state.drop && state.drop.element) !== dropElement_1) {\n if (state.drop && state.drop.onDragLeave) {\n state.drop.onDragLeave(event);\n }\n if (drop.onDragEnter) {\n drop.onDragEnter(event);\n }\n }\n else {\n if (drop.onDragOver) {\n drop.onDragOver(event);\n }\n }\n }\n else if (state.drop && state.drop.onDragLeave) {\n state.drop.onDragLeave(event);\n }\n }\n onClientOffsetChange({\n x: event.clientX,\n y: event.clientY\n });\n onPageOffsetChange({\n x: event.pageX,\n y: event.pageY\n });\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.POINTER_UP:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.POINTER_UP && !event.originalEvent.isPrimary) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.MOUSE_UP:\n // the last finger has been lifted, and the user is not doing gesture.\n // there might be a better way to handle this.\n case DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_END:\n if (event.type === DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_END && event.originalEvent.touches.length !== 1) {\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.END: {\n onIsPressedChange(false);\n onIsScrollingChange(false);\n onScrollOffsetChange({ x: 0, y: 0 });\n if (drag.onRelease) {\n drag.onRelease(event);\n }\n if (state.drop && state.drop.onDrop) {\n state.drop.onDrop(event);\n }\n if (state.drag && drag.onDragEnd) {\n drag.onDragEnd(event);\n }\n break;\n }\n case DRAG_AND_DROP_DISPATCH_ACTION.POINTER_CANCEL:\n case DRAG_AND_DROP_DISPATCH_ACTION.CONTEXT_MENU:\n case DRAG_AND_DROP_DISPATCH_ACTION.TOUCH_CANCEL:\n case DRAG_AND_DROP_DISPATCH_ACTION.CANCEL: {\n onIsPressedChange(false);\n onIsScrollingChange(false);\n onScrollOffsetChange({ x: 0, y: 0 });\n if (drag.onDragEnd) {\n drag.onDragEnd(event);\n }\n if (state.drop && state.drop.onDragLeave) {\n state.drop.onDragLeave(event);\n }\n break;\n }\n default:\n break;\n }\n};\n","import { scrollableRoot } from './utils';\n/** @hidden */\nexport var autoScroll = function (scrollableParent, vel) {\n if (!scrollableParent) {\n return;\n }\n var yIsScrollable;\n var xIsScrollable;\n var isRootNode = scrollableParent === scrollableRoot(scrollableParent);\n if (isRootNode) {\n yIsScrollable = document.body.scrollHeight > window.innerHeight;\n xIsScrollable = document.body.scrollWidth > window.innerWidth;\n }\n else {\n yIsScrollable = scrollableParent.offsetHeight <= scrollableParent.scrollHeight;\n xIsScrollable = scrollableParent.offsetWidth <= scrollableParent.scrollWidth;\n }\n var yDelta = scrollableParent.scrollTop + vel.y;\n var yInBounds = yIsScrollable && yDelta > 0 && yDelta < scrollableParent.scrollHeight;\n var xDelta = scrollableParent.scrollLeft + vel.x;\n var xInBounds = xIsScrollable && xDelta > 0 && xDelta < scrollableParent.scrollWidth;\n if (yInBounds) {\n scrollableParent.scrollTop += vel.y;\n }\n else if (yIsScrollable && yDelta < 0) {\n scrollableParent.scrollTop = 0;\n }\n if (xInBounds) {\n scrollableParent.scrollLeft += vel.x;\n }\n else if (xIsScrollable && xDelta < 0) {\n scrollableParent.scrollLeft = 0;\n }\n};\n","import * as React from 'react';\n/**\n * @hidden\n */\nexport var useInheritedState = function (context, defaultValue) {\n var _a = React.useContext(context), contextValue = _a[0], contextSetter = _a[1];\n var _b = React.useState(defaultValue), localValue = _b[0], localSetter = _b[1];\n var value = contextValue !== undefined ? contextValue : localValue;\n var handleValueChange = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n contextValue !== undefined\n ? contextSetter.apply(void 0, args) : localSetter(args[0]);\n };\n return [\n value,\n handleValueChange\n ];\n};\n","import * as React from 'react';\nimport { noop } from '../../noop';\n/**\n * @hidden\n */\nexport var DragContext = React.createContext([\n undefined,\n noop\n]);\n/**\n * @hidden\n */\nexport var DropContext = React.createContext([\n undefined,\n noop\n]);\n/**\n * @hidden\n */\nexport var DragsContext = React.createContext([[], noop, noop]);\n/**\n * @hidden\n */\nexport var DropsContext = React.createContext([[], noop, noop]);\n","import * as React from 'react';\nimport { dispatchDragAndDrop, autoScroll as autoScrollElement, getScrollableParent } from '@progress/kendo-draggable-common';\nimport { noop } from '../noop';\nimport { useInheritedState } from '../hooks/useInheritedState';\nimport { DragContext, DropContext, DragsContext, DropsContext } from '../drag-n-drop/context';\nvar IGNORE_MOUSE_TIMEOUT = 2000;\n/**\n * Represents the KendoReact `useDraggable` hook.\n * Use it to attach `drag` events to a native HTML DOM elements, or custom React Components.\n *\n * For more information, refer to the [KendoReact Draggable]({% slug draggable_drag-and-drop %}) article.\n *\n * @param ref - The `ref` of the HTML Element or React Component which will enable the `draggable` functionality.\n * @param callbacks - A collection of callbacks, called by the `useDraggable` hook when a specific action occurs.\n * @param options - Additional configuration of the `useDraggable` hook.\n */\nexport function useDraggable(ref, callbacks, options) {\n if (options === void 0) { options = {}; }\n var _a = callbacks.onPress, onPress = _a === void 0 ? noop : _a, _b = callbacks.onRelease, onRelease = _b === void 0 ? noop : _b, _c = callbacks.onDragStart, onDragStart = _c === void 0 ? noop : _c, _d = callbacks.onDrag, onDrag = _d === void 0 ? noop : _d, _e = callbacks.onDragEnd, onDragEnd = _e === void 0 ? noop : _e;\n var _f = options.hint, hint = _f === void 0 ? null : _f, _g = options.mouseOnly, mouseOnly = _g === void 0 ? false : _g, _h = options.autoScroll, autoScroll = _h === void 0 ? true : _h, _j = options.scrollContainer, scrollContainer = _j === void 0 ? null : _j;\n var _k = React.useState(false), pressed = _k[0], setPressed = _k[1];\n var _l = React.useState(false), scrolling = _l[0], setScrolling = _l[1];\n var drop = useInheritedState(DropContext)[0];\n var _m = useInheritedState(DragContext), drag = _m[0], setDrag = _m[1];\n var drops = React.useContext(DropsContext)[0];\n var _o = React.useContext(DragsContext), drags = _o[0], registerDrag = _o[1], deregisterDrag = _o[2];\n var velocity = React.useRef({ x: 0, y: 0 });\n var scrollInterval = React.useRef();\n var ignoreMouse = React.useRef(false);\n var restoreMouseTimeout = React.useRef();\n var scrollable = React.useRef(null);\n var unmount = React.useRef(false);\n var offset = React.useRef({ x: 0, y: 0 });\n var pageOffset = React.useRef({ x: 0, y: 0 });\n var clientOffset = React.useRef({ x: 0, y: 0 });\n var initialClientOffset = React.useRef({ x: 0, y: 0 });\n var scrollOffset = React.useRef({ x: 0, y: 0 });\n var initialScrollOffset = React.useRef({ x: 0, y: 0 });\n var supportPointerEvent = Boolean((typeof window !== 'undefined') && window.PointerEvent);\n var pointers = !mouseOnly && supportPointerEvent;\n var getElement = React.useCallback(function () { return ref.current && ref.current.element\n ? ref.current.element\n : ref.current; }, [ref]);\n var getHintElement = React.useCallback(function () { return hint && hint.current && hint.current.element\n ? hint.current.element\n : hint\n ? hint.current\n : null; }, [hint]);\n var getScrollContainer = React.useCallback(function () { return scrollContainer && scrollContainer.current && scrollContainer.current.element\n ? scrollContainer.current.element\n : scrollContainer\n ? scrollContainer.current\n : null; }, [scrollContainer]);\n var getAutoScrollContainer = React.useCallback(function () { return typeof autoScroll === 'object' && autoScroll.boundaryElementRef\n && autoScroll.boundaryElementRef.current && autoScroll.boundaryElementRef.current.element\n ? autoScroll.boundaryElementRef.current.element\n : typeof autoScroll === 'object' && autoScroll.boundaryElementRef && autoScroll.boundaryElementRef.current\n ? autoScroll.boundaryElementRef.current\n : null; }, [autoScroll]);\n var target = React.useRef(null);\n React.useImperativeHandle(target, function () { return ({\n element: getElement(),\n hint: getHintElement(),\n onPress: handlePress,\n onDragStart: handleDragStart,\n onDrag: handleDrag,\n onDragEnd: handleDragEnd,\n onRelease: handleRelease,\n data: ref.current\n }); });\n var getDocument = React.useCallback(function () {\n var element = getElement();\n return element ? element.ownerDocument || document : document;\n }, [getElement]);\n var getWindow = React.useCallback(function () {\n var document = getDocument();\n return document\n ? document.defaultView || window\n : window;\n }, [getDocument]);\n var getState = React.useCallback(function () { return ({\n drag: drag ? drag.current : null,\n drop: drop ? drop.current : null,\n drags: drags.map(function (d) { return d.current; }),\n drops: drops.map(function (d) { return d.current; }),\n pressed: pressed,\n ignoreMouse: ignoreMouse.current,\n scrollOffset: scrollOffset.current,\n offset: offset.current,\n pageOffset: pageOffset.current,\n initialScrollOffset: initialScrollOffset.current,\n clientOffset: clientOffset.current,\n initialClientOffset: initialClientOffset.current,\n velocity: velocity.current,\n autoScroll: Boolean(typeof autoScroll === 'object' ? autoScroll.enabled !== false : autoScroll),\n scrollableParent: getAutoScrollContainer(),\n autoScrollDirection: typeof autoScroll === 'object' ? autoScroll.direction : { horizontal: true, vertical: true },\n isScrolling: scrolling\n }); }, [drag, drop, drags, drops, pressed, autoScroll, getAutoScrollContainer, scrolling]);\n var handlePressedChange = React.useCallback(function (value) {\n setPressed(value);\n }, []);\n var handleScrollingChange = React.useCallback(function (value) {\n setScrolling(value);\n }, []);\n var handleVelocityChange = React.useCallback(function (value) {\n velocity.current = value;\n }, []);\n var handleOffsetChange = React.useCallback(function (value) {\n offset.current = value;\n }, []);\n var handleClientOffsetChange = React.useCallback(function (value) {\n clientOffset.current = value;\n }, []);\n var handlePageOffsetChange = React.useCallback(function (value) {\n pageOffset.current = value;\n }, []);\n var handleInitialClientOffsetChange = React.useCallback(function (value) {\n initialClientOffset.current = value;\n }, []);\n var handleScrollOffsetChange = React.useCallback(function (value) {\n scrollOffset.current = value;\n }, []);\n var handleInitialScrollOffsetChange = React.useCallback(function (value) {\n initialScrollOffset.current = value;\n }, []);\n // Drag Events\n var handlePress = React.useCallback(function (event) {\n onPress(event);\n }, [onPress]);\n var handleRelease = React.useCallback(function (event) {\n onRelease(event);\n }, [onRelease]);\n var handleDragStart = React.useCallback(function (event) {\n setDrag(target, { target: ref.current, event: event });\n onDragStart(event);\n }, [setDrag, ref, onDragStart]);\n var handleDrag = React.useCallback(function (event) {\n onDrag(event);\n }, [onDrag]);\n var handleDragEnd = React.useCallback(function (event) {\n if (unmount.current) {\n return;\n }\n setDrag(null, { target: ref.current, event: event });\n onDragEnd(event);\n }, [onDragEnd, setDrag, ref]);\n var dispatchDragEvent = React.useCallback(function (event) {\n dispatchDragAndDrop(getState(), { event: event, payload: target.current }, {\n onVelocityChange: handleVelocityChange,\n onOffsetChange: handleOffsetChange,\n onClientOffsetChange: handleClientOffsetChange,\n onPageOffsetChange: handlePageOffsetChange,\n onInitialClientOffsetChange: handleInitialClientOffsetChange,\n onScrollOffsetChange: handleScrollOffsetChange,\n onInitialScrollOffsetChange: handleInitialScrollOffsetChange,\n onIsPressedChange: handlePressedChange,\n onIsScrollingChange: handleScrollingChange\n });\n }, [\n getState,\n handleVelocityChange,\n handleOffsetChange,\n handlePageOffsetChange,\n handleClientOffsetChange,\n handleInitialClientOffsetChange,\n handleInitialScrollOffsetChange,\n handlePressedChange,\n handleScrollOffsetChange,\n handleScrollingChange\n ]);\n // Pointer Events\n var handlePointerDown = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handlePointerMove = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handlePointerCancel = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handlePointerUp = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n // Mouse Events\n var handleMouseDown = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handleMouseMove = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handleMouseUp = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handleContextMenu = React.useCallback(function (event) {\n event.preventDefault();\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n // Touch Events\n var handleTouchStart = React.useCallback(function (event) {\n event.preventDefault();\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handleTouchMove = React.useCallback(function (event) {\n event.preventDefault();\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n var handleTouchEnd = React.useCallback(function (event) {\n if (event.touches.length === 0 && event.changedTouches.length === 1) {\n var currentWindow = getWindow();\n ignoreMouse.current = true;\n restoreMouseTimeout.current = currentWindow.setTimeout(function () { ignoreMouse.current = false; }, IGNORE_MOUSE_TIMEOUT);\n }\n dispatchDragEvent(event);\n }, [dispatchDragEvent, getWindow]);\n var handleScroll = React.useCallback(function (event) {\n dispatchDragEvent(event);\n }, [dispatchDragEvent]);\n // Misc\n var prerequisites = React.useCallback(function () {\n var element = getElement();\n if (element) {\n var initialTouchAction_1 = element.style.touchAction;\n element.style.touchAction = 'none';\n return function () {\n element.style.touchAction = initialTouchAction_1;\n };\n }\n }, [getElement]);\n var register = React.useCallback(function () {\n registerDrag(target);\n return function () {\n deregisterDrag(target);\n };\n }, [deregisterDrag, registerDrag]);\n var init = function () {\n var window = getWindow();\n var element = getElement();\n var document = getDocument();\n if (pointers) {\n if (element) {\n scrollable.current = getScrollableParent(element);\n if (scrollable.current) {\n scrollable.current.addEventListener('scroll', handleScroll, { passive: true });\n }\n element.addEventListener('pointerdown', handlePointerDown, { passive: true });\n }\n if (pressed) {\n document.addEventListener('pointermove', handlePointerMove);\n document.addEventListener('pointerup', handlePointerUp, true);\n document.addEventListener('contextmenu', handleContextMenu);\n document.addEventListener('pointercancel', handlePointerCancel, { passive: true });\n }\n }\n else {\n // Hacky-hacky iOS Safari\n window.addEventListener('touchmove', noop, { capture: false, passive: false });\n if (element) {\n element.addEventListener('mousedown', handleMouseDown, { passive: true });\n if (!mouseOnly) {\n element.addEventListener('touchstart', handleTouchStart, { passive: true });\n if (pressed) {\n element.addEventListener('touchmove', handleTouchMove, { passive: true });\n element.addEventListener('touchend', handleTouchEnd, { passive: true });\n }\n }\n }\n if (pressed) {\n document.addEventListener('mousemove', handleMouseMove, { passive: true });\n document.addEventListener('mouseup', handleMouseUp, { passive: true });\n }\n }\n return function () {\n if (scrollable.current) {\n scrollable.current.removeEventListener('scroll', handleScroll);\n }\n if (element) {\n element.removeEventListener('pointerdown', handlePointerDown);\n element.removeEventListener('mousedown', handleMouseDown);\n element.removeEventListener('touchstart', handleTouchStart);\n element.removeEventListener('touchmove', handleTouchMove);\n element.removeEventListener('touchend', handleTouchEnd);\n }\n document.removeEventListener('pointermove', handlePointerMove);\n document.removeEventListener('pointerup', handlePointerUp, true);\n document.removeEventListener('contextmenu', handleContextMenu);\n document.removeEventListener('pointercancel', handlePointerCancel);\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n window.removeEventListener('touchmove', noop);\n window.clearTimeout(restoreMouseTimeout.current);\n };\n };\n React.useEffect(function () {\n var window = getWindow();\n if (scrolling) {\n var scrollableParent_1 = getScrollContainer()\n || getScrollableParent(document.elementFromPoint(clientOffset.current.x, clientOffset.current.y));\n window.clearInterval(scrollInterval.current);\n scrollInterval.current = window.setInterval(function () {\n autoScrollElement(scrollableParent_1, { x: velocity.current.x, y: velocity.current.y });\n }, 50);\n }\n return function () {\n window.clearInterval(scrollInterval.current);\n };\n }, [getElement, getScrollContainer, getWindow, scrolling]);\n React.useEffect(prerequisites, [prerequisites]);\n React.useEffect(init, [\n pressed,\n getWindow,\n getElement,\n getDocument,\n mouseOnly,\n pointers,\n handleContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseUp,\n handlePointerCancel,\n handlePointerDown,\n handlePointerMove,\n handlePointerUp,\n handleTouchEnd,\n handleTouchMove,\n handleTouchStart,\n handleScroll\n ]);\n React.useEffect(function () {\n unmount.current = false;\n return function () {\n unmount.current = true;\n };\n }, []);\n React.useLayoutEffect(register, [register]);\n}\n","import * as React from 'react';\nimport { useDraggable } from './hooks';\n/**\n * Represents the KendoReact Draggable component.\n *\n * Accepts properties of type [DraggableProps]({% slug api_common_draggableprops %}),\n * and returns an object of type [DraggableHandle]({% slug api_common_draggablehandle %}) when the `ref` is obtained.\n */\nexport var Draggable = React.forwardRef(function (props, ref) {\n var childRef = React.useRef(null);\n var target = React.useRef(null);\n var getElement = React.useCallback(function () { return childRef.current && childRef.current.element\n ? childRef.current.element\n : childRef.current; }, [childRef]);\n React.useImperativeHandle(target, function () { return ({ element: getElement() || null }); });\n React.useImperativeHandle(ref, function () { return target.current; });\n React.useImperativeHandle(props.childRef, function () { return childRef.current; });\n var handlePress = React.useCallback(function (event) {\n if (!props.onPress) {\n return;\n }\n props.onPress({\n element: getElement(),\n target: target.current,\n event: event\n });\n }, [getElement, props.onPress]);\n var handleRelease = React.useCallback(function (event) {\n if (!props.onRelease) {\n return;\n }\n props.onRelease({\n element: getElement(),\n target: target.current,\n event: event\n });\n }, [getElement, props.onRelease]);\n var handleDragStart = React.useCallback(function (event) {\n if (!props.onDragStart) {\n return;\n }\n props.onDragStart({\n element: getElement(),\n target: target.current,\n event: event\n });\n }, [props, getElement]);\n var handleDrag = React.useCallback(function (event) {\n if (!props.onDrag) {\n return;\n }\n props.onDrag({\n element: getElement(),\n target: target.current,\n event: event\n });\n }, [getElement, props.onDrag]);\n var handleDragEnd = React.useCallback(function (event) {\n if (!props.onDragEnd) {\n return;\n }\n props.onDragEnd({\n element: getElement(),\n target: target.current,\n event: event\n });\n }, [getElement, props.onDragEnd]);\n useDraggable(childRef, {\n onPress: handlePress,\n onRelease: handleRelease,\n onDragStart: handleDragStart,\n onDrag: handleDrag,\n onDragEnd: handleDragEnd\n }, {\n mouseOnly: props.mouseOnly,\n autoScroll: props.autoScroll,\n hint: props.hint,\n scrollContainer: props.scrollContainer\n });\n return props.children\n ? (React.cloneElement(React.Children.only(props.children), { ref: childRef }))\n : null;\n});\nDraggable.displayName = 'KendoReactDraggable';\n","/** @hidden */\nexport var kendoThemeMaps = {\n sizeMap: {\n small: 'sm',\n medium: 'md',\n large: 'lg'\n },\n roundedMap: {\n small: 'sm',\n medium: 'md',\n large: 'lg'\n }\n};\n","function isEqual(first, second) {\n return (first === second) || (Number.isNaN(first) && Number.isNaN(second));\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n/**\n * @hidden\n */\nexport function memoizeOne(resultFn, isEqualFn) {\n if (isEqualFn === void 0) { isEqualFn = areInputsEqual; }\n var cache = null;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (cache && cache.lastThis === this && isEqualFn(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n var lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult: lastResult,\n lastArgs: newArgs,\n lastThis: this\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n","/**\n * @hidden\n */\nexport var FOCUSABLE_ELEMENTS = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n/**\n * Represents the [KendoReact Navigation functionality]({% slug overview_navigation %}).\n * It handles the navigation through a collection of DOM elements.\n */\nvar Navigation = /** @class */ (function () {\n function Navigation(options) {\n var _this = this;\n /**\n * @hidden\n */\n this.rovingTabIndex = true;\n /**\n * @hidden\n */\n this.update = function () { };\n this.focusNextIndex = function (target, indexDiff) {\n var all = _this.elements;\n var index = all.indexOf(target) + indexDiff;\n index = index < 0 ? all.length - 1 : index;\n var next = all[index % all.length];\n _this.focusElement(next, target);\n return next;\n };\n this.tabIndex = options.tabIndex || 0;\n this.root = options.root;\n this.selectors = options.selectors;\n this.rovingTabIndex = options.rovingTabIndex !== undefined ? options.rovingTabIndex : true;\n this.mouseEvents = options.mouseEvents || {};\n this.keyboardEvents = options.keyboardEvents || {};\n }\n Object.defineProperty(Navigation.prototype, \"elements\", {\n /**\n * Returns the collection of DOM elements which the module will navigate in.\n */\n get: function () {\n return this.root.current ? Array.from(this.root.current.querySelectorAll(this.selectors.join(','))) : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"first\", {\n /**\n * Returns the first navigation DOM element.\n */\n get: function () {\n return (this.root.current && this.root.current.querySelector(this.selectors.join(','))) || null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"last\", {\n /**\n * Returns the last navigation DOM element.\n */\n get: function () {\n var all = this.elements;\n return all[all.length - 1] || null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"current\", {\n /**\n * Returns the focused DOM element from the navigation collection of DOM elements.\n */\n get: function () {\n return this.elements.find(function (el) { return el.matches(':focus'); }) || null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Focuses the next element from the navigation collection of DOM elements.\n */\n Navigation.prototype.focusNext = function (target) {\n return this.focusNextIndex(target, 1);\n };\n /**\n * Focuses the previous element from the navigation collection of DOM elements.\n */\n Navigation.prototype.focusPrevious = function (target) {\n return this.focusNextIndex(target, -1);\n };\n /**\n * The keyboard events handler.\n */\n Navigation.prototype.triggerKeyboardEvent = function (ev) {\n var target = ev.target instanceof Element && ev.target.closest(this.selectors.join(','));\n var key = ev.key === ' ' ? 'Space' : ev.key;\n var eventType = ev.nativeEvent.type;\n if (target && this.keyboardEvents[eventType][key]) {\n this.keyboardEvents[eventType][key].call(undefined, target, this, ev);\n }\n };\n /**\n * The mouse events handler.\n */\n Navigation.prototype.triggerMouseEvent = function (ev) {\n var target = ev.target instanceof Element && ev.target.closest(this.selectors.join(','));\n var eventType = ev.nativeEvent.type;\n if (target) {\n this.mouseEvents[eventType].call(undefined, target, this, ev);\n }\n };\n /**\n * Focuses the passed element from the navigation collection of DOM elements.\n */\n Navigation.prototype.focusElement = function (element, previous) {\n if (element) {\n if (previous) {\n if (this.rovingTabIndex) {\n previous.removeAttribute('tabindex');\n }\n previous.classList.remove('k-focus');\n }\n if (this.rovingTabIndex) {\n element.setAttribute('tabindex', String(this.tabIndex));\n }\n element.focus({ preventScroll: true });\n }\n };\n return Navigation;\n}());\nexport { Navigation };\n;\n","/**\n * @hidden\n */\nexport var getInnerActiveElement = function (element) {\n var shadowRoot = element.shadowRoot;\n var contentDocument = element.contentDocument;\n if (shadowRoot && shadowRoot.activeElement) {\n return getInnerActiveElement(shadowRoot.activeElement);\n }\n if (contentDocument && contentDocument.activeElement) {\n return getInnerActiveElement(contentDocument.activeElement);\n }\n return element;\n};\n/**\n * @hidden\n */\nexport var getActiveElement = function (document) {\n if (!document || !document.activeElement) {\n return undefined;\n }\n return getInnerActiveElement(document.activeElement);\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-buttons',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801029,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, kendoThemeMaps, IconWrap, svgIconPropType } from '@progress/kendo-react-common';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from './package-metadata';\n/**\n * @hidden\n */\nfunction iconElement(_a) {\n var imageUrl = _a.imageUrl, name = _a.name, iconClass = _a.iconClass, svgIcon = _a.svgIcon, imageAlt = _a.imageAlt;\n if (imageUrl) {\n return (React.createElement(\"img\", { role: \"presentation\", className: 'k-button-icon', alt: imageAlt, src: imageUrl }));\n }\n else if (name || svgIcon) {\n return React.createElement(IconWrap, { className: 'k-button-icon', name: name, icon: svgIcon });\n }\n else if (iconClass) {\n return (React.createElement(\"span\", { role: \"presentation\", className: classNames('k-button-icon', iconClass) }));\n }\n return null;\n}\nvar Button = /** @class */ (function (_super) {\n __extends(Button, _super);\n function Button(props) {\n var _this = _super.call(this, props) || this;\n _this._element = null;\n _this.handleClick = function (event) {\n _this.toggleIfApplicable();\n if (_this.props.onClick) {\n _this.props.onClick.call(undefined, event);\n }\n };\n validatePackage(packageMetadata);\n _this.state = { selected: _this.props.togglable === true && _this.props.selected === true };\n return _this;\n }\n Object.defineProperty(Button.prototype, \"element\", {\n /**\n * Gets the DOM element of the Button component.\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Button.prototype, \"selected\", {\n /**\n * Returns `true` when the component is togglable and selected ([see example]({% slug toggleable_button %})).\n * Otherwise, returns `false`.\n */\n get: function () {\n return this._selectedTemp !== undefined ? this._selectedTemp : this.state.selected;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n Button.getDerivedStateFromProps = function (props, state) {\n if (props.togglable && props.selected !== undefined && props.selected !== state.selected) {\n return { selected: props.selected };\n }\n return null;\n };\n /**\n * @hidden\n */\n Button.prototype.render = function () {\n var _a;\n var _this = this;\n var _b = this.props, children = _b.children, togglable = _b.togglable, icon = _b.icon, iconClass = _b.iconClass, svgIcon = _b.svgIcon, imageUrl = _b.imageUrl, imageAlt = _b.imageAlt, className = _b.className, onClick = _b.onClick, _c = _b.size, size = _c === void 0 ? Button.defaultProps.size : _c, _d = _b.rounded, rounded = _d === void 0 ? Button.defaultProps.rounded : _d, _e = _b.fillMode, fillMode = _e === void 0 ? Button.defaultProps.fillMode : _e, _f = _b.themeColor, themeColor = _f === void 0 ? Button.defaultProps.themeColor : _f, htmlAttributes = __rest(_b, [\"children\", \"togglable\", \"icon\", \"iconClass\", \"svgIcon\", \"imageUrl\", \"imageAlt\", \"className\", \"onClick\", \"size\", \"rounded\", \"fillMode\", \"themeColor\"]);\n var hasIcon = (icon !== undefined || iconClass !== undefined || imageUrl !== undefined);\n var hasChildren = children !== undefined;\n var iconEl = iconElement({\n name: icon,\n svgIcon: svgIcon,\n iconClass: iconClass,\n imageUrl: imageUrl,\n imageAlt: imageAlt\n });\n return (React.createElement(\"button\", __assign({ ref: function (button) { return _this._element = button; }, \"aria-pressed\": togglable ? this.state.selected : undefined }, htmlAttributes, { onClick: this.handleClick, className: classNames('k-button', (_a = {},\n _a[\"k-button-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _a[\"k-button-\".concat(fillMode)] = fillMode,\n _a[\"k-button-\".concat(fillMode, \"-\").concat(themeColor)] = Boolean(fillMode && themeColor),\n _a[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,\n _a['k-icon-button'] = !hasChildren && hasIcon,\n _a['k-disabled'] = this.props.disabled,\n _a['k-selected'] = this.state.selected,\n _a['k-rtl'] = this.props.dir === 'rtl',\n _a), this.props.className) }),\n iconEl,\n children && (React.createElement(\"span\", { className: \"k-button-text\" }, children))));\n };\n Button.prototype.toggleIfApplicable = function () {\n var _this = this;\n if (this.props.togglable && this.props.selected === undefined) {\n var selected = !this.state.selected;\n this._selectedTemp = selected;\n this.setState({ selected: selected }, function () { return _this._selectedTemp = undefined; });\n }\n };\n /**\n * @hidden\n */\n Button.propTypes = {\n children: PropTypes.node,\n selected: PropTypes.bool,\n togglable: PropTypes.bool,\n icon: PropTypes.string,\n svgIcon: svgIconPropType,\n iconClass: PropTypes.string,\n imageUrl: PropTypes.string,\n imageAlt: PropTypes.string,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'flat', 'link', 'outline', 'solid']),\n // eslint-disable-next-line max-len\n themeColor: PropTypes.oneOf([null, 'base', 'primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'error', 'dark', 'light', 'inverse'])\n };\n /**\n * @hidden\n */\n Button.defaultProps = {\n togglable: false,\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid',\n themeColor: 'base'\n };\n return Button;\n}(React.Component));\nexport { Button };\n","var clearSlide = function (element) {\n element.style.transitionDuration = '';\n Array.from(element.classList).forEach(function (c) {\n if (c.startsWith('k-slide-')) {\n element.classList.remove(c);\n }\n });\n};\nvar firefox = typeof window !== 'undefined' &&\n /Firefox/.test(window.navigator.userAgent);\n/**\n * @hidden\n */\nexport var slide = function (element, direction, duration, type, callback) {\n if (duration === 0) {\n return callback();\n }\n var slideClass = 'k-slide-' + direction + '-' + type;\n var slideActiveClass = slideClass + '-active';\n var transitionend = function (e) {\n // if event is attached using react,\n // the animation does not work well in firefox,\n // when the show/hide button is toggled quickly.\n if (e.target === element) {\n element.removeEventListener('transitionend', transitionend);\n clearSlide(element);\n if (type === 'exit') {\n element.style.display = 'none';\n }\n else {\n element.style.display = '';\n }\n callback();\n }\n };\n element.addEventListener('transitionend', transitionend);\n var ownerDocument = element.ownerDocument;\n if (!ownerDocument) {\n return;\n }\n var defaultView = ownerDocument.defaultView;\n if (!defaultView) {\n return;\n }\n var animate = function () {\n clearSlide(element);\n element.classList.add(slideClass);\n defaultView.requestAnimationFrame(function () {\n element.style.transitionDuration = duration + 'ms';\n element.classList.add(slideActiveClass);\n });\n };\n if (firefox) {\n defaultView.requestAnimationFrame(animate);\n }\n else {\n animate();\n }\n};\n","export default {\n \"bottom\": \"bottom\",\n \"center\": \"center\",\n \"middle\": \"middle\",\n \"left\": \"left\",\n \"right\": \"right\",\n \"top\": \"top\"\n};\n","import point from './align-point';\n\nvar align = function (options) {\n var anchorRect = options.anchorRect;\n var anchorAlign = options.anchorAlign;\n var elementRect = options.elementRect;\n var elementAlign = options.elementAlign;\n var margin = options.margin; if ( margin === void 0 ) margin = {};\n var anchorHorizontal = anchorAlign.horizontal;\n var anchorVertical = anchorAlign.vertical;\n var elementHorizontal = elementAlign.horizontal;\n var elementVertical = elementAlign.vertical;\n\n var horizontalMargin = margin.horizontal || 0;\n var verticalMargin = margin.vertical || 0;\n\n var top = anchorRect.top;\n var left = anchorRect.left;\n\n if (anchorVertical === point.bottom) {\n top += anchorRect.height;\n }\n\n if (anchorVertical === point.center || anchorVertical === point.middle) {\n top += Math.round(anchorRect.height / 2);\n }\n\n if (elementVertical === point.bottom) {\n top -= elementRect.height;\n verticalMargin *= -1;\n }\n\n if (elementVertical === point.center || elementVertical === point.middle) {\n top -= Math.round(elementRect.height / 2);\n verticalMargin *= -1;\n }\n\n if (anchorHorizontal === point.right) {\n left += anchorRect.width;\n }\n\n if (anchorHorizontal === point.center || anchorHorizontal === point.middle) {\n left += Math.round(anchorRect.width / 2);\n }\n\n if (elementHorizontal === point.right) {\n left -= elementRect.width;\n horizontalMargin *= -1;\n }\n\n if (elementHorizontal === point.center || elementHorizontal === point.middle) {\n left -= Math.round(elementRect.width / 2);\n horizontalMargin *= -1;\n }\n\n return {\n top: top + verticalMargin,\n left: left + horizontalMargin\n };\n};\n\nexport default align;\n","export default function addScroll(rect, scroll) {\n return {\n top: rect.top + scroll.y,\n left: rect.left + scroll.x,\n height: rect.height,\n width: rect.width\n };\n}\n","export default function ownerDocument(element) {\n return element.ownerDocument || element.document || element;\n}\n","import ownerDocument from './owner-document';\n\nvar getWindow = function (element) { return ownerDocument(element).defaultView; };\n\nexport default getWindow;\n","import ownerDocument from './owner-document';\n\nvar getDocument = function (element) { return ownerDocument(element).documentElement; };\n\nexport default getDocument;\n","var cachedWidth = 0;\n\nexport default function scrollbarWidth() {\n if (!cachedWidth && typeof document !== 'undefined') {\n var div = document.createElement(\"div\");\n\n div.style.cssText = \"overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block\";\n div.innerHTML = \" \";\n document.body.appendChild(div);\n\n cachedWidth = div.offsetWidth - div.scrollWidth;\n\n document.body.removeChild(div);\n }\n\n return cachedWidth;\n}\n","import wnd from './window';\nimport getDocument from './document';\nimport scrollbarWidth from './scrollbar-width';\n\nexport default function windowViewport(element) {\n var win = wnd(element);\n var document = getDocument(element);\n var result = {\n height: win.innerHeight,\n width: win.innerWidth\n };\n\n if (document.scrollHeight - document.clientHeight > 0) {\n result.width -= scrollbarWidth();\n }\n\n return result;\n}\n","import windowViewport from './window-viewport';\n\nvar boundingOffset = function (element) {\n if (!element.getBoundingClientRect) {\n var viewport = windowViewport(element);\n return {\n bottom: viewport.height,\n left: 0,\n right: viewport.width,\n top: 0\n };\n }\n\n var ref = element.getBoundingClientRect();\n var bottom = ref.bottom;\n var left = ref.left;\n var right = ref.right;\n var top = ref.top;\n\n return {\n bottom: bottom,\n left: left,\n right: right,\n top: top\n };\n};\n\nexport default boundingOffset;\n","import documentElement from './document';\n\nvar offsetParent = function (element) {\n var offsetParent = element.offsetParent;\n\n while (offsetParent && offsetParent.style.position === \"static\") {\n offsetParent = offsetParent.offsetParent;\n }\n\n return offsetParent || documentElement(element);\n};\n\nexport default offsetParent;\n","var rectOfHiddenElement = function (element) {\n var ref = element.style;\n var display = ref.display;\n var left = ref.left;\n var position = ref.position;\n\n element.style.display = '';\n element.style.left = '-10000px';\n element.style.position = 'absolute';\n\n var rect = element.getBoundingClientRect();\n\n element.style.display = display;\n element.style.left = left;\n element.style.position = position;\n\n return rect;\n};\n\nvar offset = function (element) {\n var rect = element.getBoundingClientRect();\n var left = rect.left;\n var top = rect.top;\n\n if (!rect.height && !rect.width) {\n rect = rectOfHiddenElement(element);\n }\n\n return {\n top: top,\n left: left,\n height: rect.height,\n width: rect.width\n };\n};\n\nexport default offset;\n","export default function (element, until) {\n var result = [];\n var next = element.parentNode;\n\n while (next) {\n result.push(next);\n\n if (next === until) { break; }\n\n next = next.parentNode;\n }\n\n return result;\n};\n","import docElement from './document';\nimport wnd from './window';\n\nexport default function scrollPosition(element) {\n var documentElement = docElement(element);\n var win = wnd(element);\n\n return {\n x: win.pageXOffset || documentElement.scrollLeft || 0,\n y: win.pageYOffset || documentElement.scrollTop || 0\n };\n}\n","import scrollPosition from './scroll-position';\n\nexport default function (element) {\n if (element === (element.ownerDocument || {}).body) {\n return scrollPosition(element);\n }\n\n return {\n x: element.scrollLeft,\n y: element.scrollTop\n };\n};\n","import offsetParent from './offset-parent';\nimport elementScrollPosition from './element-scroll-position';\n\nexport default function parentScrollPosition(element) {\n var parent = offsetParent(element);\n\n return parent ? elementScrollPosition(parent) : { x: 0, y: 0 };\n}\n","import offsetParent from './offset-parent';\nimport offsetRect from './offset';\nimport wnd from './window';\n\nvar position = function (element, parent) {\n var win = wnd(element);\n var elementStyles = win.getComputedStyle(element);\n var offset = offsetRect(element);\n var parentElement = parent || offsetParent(element);\n\n var ownerDocument = element.ownerDocument;\n var useRelative = parentElement !== ownerDocument.body && parentElement !== ownerDocument.documentElement;\n\n var parentOffset = { top: 0, left: 0 };\n\n if (elementStyles.position !== \"fixed\" && useRelative) {\n var parentStyles = win.getComputedStyle(parentElement);\n\n parentOffset = offsetRect(parentElement);\n parentOffset.top += parseInt(parentStyles.borderTopWidth, 10);\n parentOffset.left += parseInt(parentStyles.borderLeftWidth, 10);\n }\n\n return {\n top: offset.top - parentOffset.top,\n left: offset.left - parentOffset.left,\n height: offset.height,\n width: offset.width\n };\n};\n\nexport default position;\n","import elementScrollPosition from './element-scroll-position';\nimport parentScrollPosition from './parent-scroll-position';\n\nexport default function (offsetParentElement, element) { return ( // eslint-disable-line no-arrow-condition\n offsetParentElement ? elementScrollPosition(offsetParentElement) : parentScrollPosition(element)\n); };\n","import offsetParentScrollPosition from './offset-parent-scroll-position';\nimport offsetParent from './offset-parent';\nimport position from './position';\n\nexport default function (element, parent, scale) {\n if ( scale === void 0 ) scale = 1;\n\n var offsetParentElement = parent ? offsetParent(parent) : null;\n var ref = position(element, offsetParentElement);\n var top = ref.top;\n var left = ref.left;\n var height = ref.height;\n var width = ref.width;\n var ref$1 = offsetParentScrollPosition(offsetParentElement, element);\n var x = ref$1.x;\n var y = ref$1.y;\n var ownerDocument = element.ownerDocument;\n var positionScale = offsetParentElement === ownerDocument.body || offsetParentElement === ownerDocument.documentElement ? 1 : scale;\n\n return {\n top: top + y * positionScale,\n left: left + x * positionScale,\n height: height,\n width: width\n };\n};\n","export default function removeScroll(rect, scroll) {\n return {\n top: rect.top - scroll.y,\n left: rect.left - scroll.x,\n height: rect.height,\n width: rect.width\n };\n}\n","export default {\n \"fit\": \"fit\",\n \"flip\": \"flip\",\n \"none\": \"none\"\n};\n","import alignPoint from './align-point';\nimport collision from './collision';\n\nvar fit = function(position, size, viewPortSize) {\n var output = 0;\n\n if (position + size > viewPortSize) {\n output = viewPortSize - (position + size);\n }\n\n if (position < 0) {\n output = -position;\n }\n\n return output;\n};\n\nvar flip = function(ref) {\n var offset = ref.offset;\n var size = ref.size;\n var anchorSize = ref.anchorSize;\n var viewPortSize = ref.viewPortSize;\n var anchorAlignPoint = ref.anchorAlignPoint;\n var elementAlignPoint = ref.elementAlignPoint;\n var margin = ref.margin;\n\n var output = 0;\n\n var isPositionCentered = elementAlignPoint === alignPoint.center || elementAlignPoint === alignPoint.middle;\n var isOriginCentered = anchorAlignPoint === alignPoint.center || anchorAlignPoint === alignPoint.middle;\n var marginToAdd = 2 * margin; //2x to keep margin after flip\n\n if (elementAlignPoint !== anchorAlignPoint && !isPositionCentered && !isOriginCentered) {\n var isBeforeAnchor = anchorAlignPoint === alignPoint.top || anchorAlignPoint === alignPoint.left;\n if (offset < 0 && isBeforeAnchor) {\n output = size + anchorSize + marginToAdd;\n if (offset + output + size > viewPortSize) {\n output = 0; //skip flip\n }\n } else if (offset >= 0 && !isBeforeAnchor) {\n if (offset + size > viewPortSize) {\n output += -(anchorSize + size + marginToAdd);\n }\n\n if (offset + output < 0) {\n output = 0; //skip flip\n }\n }\n }\n\n return output;\n};\n\nvar restrictToView = function (options) {\n var anchorRect = options.anchorRect;\n var anchorAlign = options.anchorAlign;\n var elementRect = options.elementRect;\n var elementAlign = options.elementAlign;\n var collisions = options.collisions;\n var viewPort = options.viewPort;\n var margin = options.margin; if ( margin === void 0 ) margin = {};\n var elementTop = elementRect.top;\n var elementLeft = elementRect.left;\n var elementHeight = elementRect.height;\n var elementWidth = elementRect.width;\n var viewPortHeight = viewPort.height;\n var viewPortWidth = viewPort.width;\n var horizontalMargin = margin.horizontal || 0;\n var verticalMargin = margin.vertical || 0;\n\n var left = 0;\n var top = 0;\n\n var isVerticalFit = collisions.vertical === collision.fit;\n var isHorizontalFit = collisions.horizontal === collision.fit;\n var isVerticalFlip = collisions.vertical === collision.flip;\n var isHorizontalFlip = collisions.horizontal === collision.flip;\n\n if (isVerticalFit) {\n top += fit(elementTop, elementHeight, viewPortHeight);\n }\n\n if (isHorizontalFit) {\n left += fit(elementLeft, elementWidth, viewPortWidth);\n }\n\n if (isVerticalFlip) {\n top += flip({\n margin: verticalMargin,\n offset: elementTop,\n size: elementHeight,\n anchorSize: anchorRect.height,\n viewPortSize: viewPortHeight,\n anchorAlignPoint: anchorAlign.vertical,\n elementAlignPoint: elementAlign.vertical\n });\n }\n\n if (isHorizontalFlip) {\n left += flip({\n margin: horizontalMargin,\n offset: elementLeft,\n size: elementWidth,\n anchorSize: anchorRect.width,\n viewPortSize: viewPortWidth,\n anchorAlignPoint: anchorAlign.horizontal,\n elementAlignPoint: elementAlign.horizontal\n });\n }\n\n var flippedVertical = isVerticalFlip && top !== 0;\n var flippedHorizontal = isHorizontalFlip && left !== 0;\n var fittedVertical = isVerticalFit && top !== 0;\n var fittedHorizontal = isHorizontalFit && left !== 0;\n\n return {\n flipped: flippedHorizontal || flippedVertical,\n fitted: fittedVertical || fittedHorizontal,\n flip: {\n horizontal: flippedHorizontal,\n vertical: flippedVertical\n },\n fit: {\n horizontal: fittedHorizontal,\n vertical: fittedVertical\n },\n offset: {\n left: left,\n top: top\n }\n };\n};\n\nexport default restrictToView;\n","export default function (element) {\n var result = [];\n\n var sibling = element.parentNode.firstElementChild;\n\n while (sibling) {\n if (sibling !== element) {\n result.push(sibling);\n }\n\n sibling = sibling.nextElementSibling;\n }\n return result;\n};\n","/* eslint-disable no-loop-func */\n\nimport parents from './parents';\nimport siblings from './siblings';\n\nexport default function (anchor, container) {\n var parentElements = parents(anchor);\n var containerElement = container;\n var siblingElements;\n var result;\n\n while (containerElement) {\n siblingElements = siblings(containerElement);\n\n result = parentElements.reduce(\n function (list, p) { return list.concat(siblingElements.filter(function (s) { return s === p; })); },\n []\n )[0];\n\n if (result) { break; }\n\n containerElement = containerElement.parentElement;\n }\n\n return result;\n};\n\n","\nvar eitherRect = function (rect, offset) {\n if (!rect) {\n return { height: 0, left: offset.left, top: offset.top, width: 0 };\n }\n\n return rect;\n};\n\nvar scaleRect = function (rect, scale) {\n if (!rect || scale === 1) {\n return rect;\n }\n\n return {\n height: rect.height / scale,\n left: rect.left / scale,\n top: rect.top / scale,\n width: rect.width / scale\n };\n};\n\nvar removeStackingOffset = function (rect, stackingOffset) {\n if (!stackingOffset) { return rect; }\n\n var result = {\n height: rect.height,\n left: rect.left - stackingOffset.left,\n top: rect.top - stackingOffset.top,\n width: rect.width\n };\n\n return result;\n};\n\nfunction memoize(fun) {\n var result;\n var called = false;\n\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) {\n return result;\n }\n\n result = fun.apply(void 0, args);\n called = true;\n return result;\n };\n}\n\nvar hasRelativeStackingContext = memoize(function (elementSource) {\n if (!canUseDOM()) { return false; }\n\n // Component need to pass element to make sure document owner is correct.\n // This however might be performance hit if checked for example on each drag event.\n var currentDocument = elementSource ? elementSource.ownerDocument : document;\n\n if (!currentDocument || !currentDocument.body) { return false; }\n\n var top = 10;\n var parent = currentDocument.createElement(\"div\");\n parent.style.transform = \"matrix(10, 0, 0, 10, 0, 0)\";\n parent.innerHTML = \"

child
\";\n\n currentDocument.body.appendChild(parent);\n\n var isDifferent = parent.children[0].getBoundingClientRect().top !== top;\n\n currentDocument.body.removeChild(parent);\n\n return isDifferent;\n});\n\nvar canUseDOM = function () { return Boolean(\n // from fbjs\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n); };\n\nvar utils = {\n eitherRect: eitherRect,\n scaleRect: scaleRect,\n removeStackingOffset: removeStackingOffset,\n hasRelativeStackingContext: hasRelativeStackingContext,\n canUseDOM: canUseDOM\n};\n\nexport default utils;","/* eslint-disable arrow-body-style */\nimport addScroll from \"./add-scroll\";\nimport align from './align';\nimport boundingOffset from './bounding-offset';\nimport utils from './utils';\nimport removeScroll from './remove-scroll';\nimport restrictToView from './restrict-to-view';\nimport scrollPosition from './scroll-position';\nimport offsetBase from './offset';\nimport positionWithScroll from './position-with-scroll';\nimport windowViewPort from './window-viewport';\nimport siblingContainer from './sibling-container';\nimport parents from './parents';\n\nvar STYLES = [\n 'font-size',\n 'font-family',\n 'font-stretch',\n 'font-style',\n 'font-weight',\n 'line-height'\n];\n\nvar addOffset = function (current, addition) {\n return {\n left: current.left + addition.left,\n top: current.top + addition.top\n };\n};\n\nvar getWindow = function () {\n return utils.canUseDOM() ? window : null;\n};\n\nvar getFontStyles = function (el) {\n var window = getWindow();\n\n if (!window || !el) { return []; }\n\n var computedStyles = window.getComputedStyle(el);\n\n return STYLES.map(function (font) { return ({ key: font, value: computedStyles[font] }); });\n};\n\nvar hasOffsetParent = function (el) {\n if (!el) { return false; }\n\n return Boolean(el.offsetParent);\n};\n\nvar offset = function (el) {\n if (!el) { return null; }\n\n return offsetBase(el);\n};\n\nvar offsetAtPoint = function (element, currentLocation) {\n if (!element) { return null; }\n\n var ref = element.style;\n var left = ref.left;\n var top = ref.top;\n var transition = ref.transition;\n\n element.style.transition = 'none';\n element.style.left = (currentLocation.left) + \"px\";\n element.style.top = (currentLocation.top) + \"px\";\n\n var currentOffset = offsetBase(element);\n\n element.style.left = left;\n element.style.top = top;\n\n // prevents elements with transition to be animated because of the change\n // tslint:disable-next-line:no-unused-expression\n element.offsetHeight;\n\n element.style.transition = transition;\n\n return currentOffset;\n};\n\nvar position = function (element, popupElement, scale) {\n if (!element || !popupElement) { return null; }\n\n var currentScale = scale || 1;\n\n return positionWithScroll(element, popupElement, currentScale);\n};\n\nvar OVERFLOW_REGEXP = /auto|scroll/;\n\nvar overflowElementStyle = function (element) {\n return (\"\" + (element.style.overflow) + (element.style.overflowX) + (element.style.overflowY));\n};\n\nvar overflowComputedStyle = function (element) {\n var styles = window.getComputedStyle(element);\n return (\"\" + (styles.overflow) + (styles.overflowX) + (styles.overflowY));\n};\n\nvar overflowStyle = function (element) {\n return overflowElementStyle(element) || overflowComputedStyle(element);\n};\n\nvar scrollableParents = function (element) {\n var parentElements = [];\n\n if (!utils.canUseDOM()) { return parentElements; }\n\n var parent = element.parentElement;\n\n while (parent) {\n if (OVERFLOW_REGEXP.test(overflowStyle(parent)) || parent.hasAttribute('data-scrollable')) {\n parentElements.push(parent);\n }\n\n parent = parent.parentElement;\n }\n\n parentElements.push(window);\n\n return parentElements;\n};\n\nvar getRelativeContextElement = function (el) {\n if (!el || !utils.hasRelativeStackingContext()) { return null; }\n\n var parent = el.parentElement;\n\n while (parent) {\n if (window.getComputedStyle(parent).transform !== 'none') {\n return parent;\n }\n parent = parent.parentElement;\n }\n\n return null;\n};\n\nvar stackingElementOffset = function (el) {\n var relativeContextElement = getRelativeContextElement(el);\n\n if (!relativeContextElement) { return null; }\n\n return offsetBase(relativeContextElement);\n};\n\nvar stackingElementScroll = function (el) {\n var relativeContextElement = getRelativeContextElement(el);\n\n if (!relativeContextElement) { return { x: 0, y: 0 }; }\n\n return {\n x: relativeContextElement.scrollLeft,\n y: relativeContextElement.scrollTop\n };\n};\n\nvar stackingElementViewPort = function (el) {\n var relativeContextElement = getRelativeContextElement(el);\n\n if (!relativeContextElement) { return null; }\n\n return {\n height: relativeContextElement.scrollHeight,\n width: relativeContextElement.scrollWidth\n };\n};\n\nvar useRelativePosition = function (el) {\n return Boolean(getRelativeContextElement(el));\n};\n\nvar zoomLevel = function () {\n if (!utils.canUseDOM()) { return 1; }\n\n return parseFloat((document.documentElement.clientWidth / window.innerWidth).toFixed(2)) || 1;\n};\n\nvar isZoomed = function () {\n return zoomLevel() > 1;\n};\n\nvar zIndex = function (anchor, container) {\n if (!anchor || !utils.canUseDOM()) { return null; }\n\n var sibling = siblingContainer(anchor, container);\n\n if (!sibling) { return null; }\n\n var result = [ anchor ].concat(parents(anchor, sibling)).reduce(\n function (index, p) {\n var zIndexStyle = p.style.zIndex || window.getComputedStyle(p).zIndex;\n var current = parseInt(zIndexStyle, 10);\n return current > index ? current : index;\n },\n 0\n );\n\n return result ? (result + 1) : null;\n};\n\nvar domUtils = {\n addOffset: addOffset,\n addScroll: addScroll,\n align: align,\n boundingOffset: boundingOffset,\n getFontStyles: getFontStyles,\n getWindow: getWindow,\n hasOffsetParent: hasOffsetParent,\n offset: offset,\n offsetAtPoint: offsetAtPoint,\n position: position,\n removeScroll: removeScroll,\n restrictToView: restrictToView,\n scrollPosition: scrollPosition,\n scrollableParents: scrollableParents,\n getRelativeContextElement: getRelativeContextElement,\n stackingElementOffset: stackingElementOffset,\n stackingElementScroll: stackingElementScroll,\n stackingElementViewPort: stackingElementViewPort,\n useRelativePosition: useRelativePosition,\n windowViewPort: windowViewPort,\n zoomLevel: zoomLevel,\n isZoomed: isZoomed,\n zIndex: zIndex\n};\n\nexport default domUtils;\n","/* eslint-disable arrow-body-style */\n\nimport utils from './utils';\nimport domUtils from \"./dom-utils\";\n\nvar absoluteRect = function (anchor, element, offset, scale) {\n var scrollPos = elementScrollPosition(anchor, element);\n var rect = utils.eitherRect(domUtils.offset(anchor), offset);\n var stackScale = 2 * scale;\n\n var stackScroll = domUtils.stackingElementScroll(element);\n if (scale !== 1 && stackScroll) {\n stackScroll.x /= stackScale;\n stackScroll.y /= stackScale;\n }\n\n var stackOffset = domUtils.stackingElementOffset(element);\n if (scale !== 1 && stackOffset) {\n stackOffset.left /= stackScale;\n stackOffset.top /= stackScale;\n }\n\n return domUtils.removeScroll(\n domUtils.addScroll(\n utils.removeStackingOffset(\n utils.scaleRect(rect, scale),\n stackOffset\n ),\n stackScroll\n ),\n scrollPos\n );\n};\n\nvar relativeRect = function (anchor, element, offset, scale) {\n var rect = utils.eitherRect(domUtils.position(anchor, element, scale), offset);\n return utils.scaleRect(rect, scale);\n};\n\nvar elementScrollPosition = function (anchor, element) {\n return anchor ? { x: 0, y: 0 } : domUtils.scrollPosition(element);\n};\n\nvar alignElement = function (settings) {\n var anchor = settings.anchor;\n var element = settings.element;\n var anchorAlign = settings.anchorAlign;\n var elementAlign = settings.elementAlign;\n var margin = settings.margin;\n var offset = settings.offset;\n var positionMode = settings.positionMode;\n var scale = settings.scale;\n\n var currentScale = scale || 1;\n var fixedMode = positionMode === 'fixed' || !domUtils.hasOffsetParent(element);\n var anchorRect = fixedMode ? absoluteRect(anchor, element, offset, currentScale) : relativeRect(anchor, element, offset, currentScale);\n var elementRect = utils.scaleRect(domUtils.offset(element), currentScale);\n\n var result = domUtils.align({\n anchorAlign: anchorAlign,\n anchorRect: anchorRect,\n elementAlign: elementAlign,\n elementRect: elementRect,\n margin: margin\n });\n\n return result;\n};\n\nexport default alignElement;\n","import utils from \"./utils\";\nimport domUtils from \"./dom-utils\";\n\nvar positionElement = function (settings) {\n var anchor = settings.anchor;\n var currentLocation = settings.currentLocation;\n var element = settings.element;\n var anchorAlign = settings.anchorAlign;\n var elementAlign = settings.elementAlign;\n var collisions = settings.collisions;\n var margin = settings.margin;\n var scale = settings.scale;\n\n var currentScale = scale || 1;\n var elementOffset = domUtils.offsetAtPoint(element, currentLocation);\n var elementRect = utils.scaleRect(elementOffset, currentScale);\n var anchorOffset = utils.scaleRect(domUtils.offset(anchor), currentScale);\n var anchorRect = utils.eitherRect(anchorOffset, currentLocation);\n\n var viewPort = settings.viewPort || domUtils.windowViewPort(element);\n viewPort.width = viewPort.width / currentScale;\n viewPort.height = viewPort.height / currentScale;\n\n var result = domUtils.restrictToView({\n anchorAlign: anchorAlign,\n anchorRect: anchorRect,\n collisions: collisions,\n elementAlign: elementAlign,\n elementRect: elementRect,\n margin: margin,\n viewPort: viewPort\n });\n\n var offset = domUtils.addOffset(currentLocation, result.offset);\n\n return {\n flip: result.flip,\n flipped: result.flipped,\n fit: result.fit,\n fitted: result.fitted,\n offset: offset\n };\n};\n\nexport default positionElement;","/**\n * @hidden\n */\nexport var isDifferentOffset = function (oldOffset, newOffset) {\n var oldLeft = oldOffset.left, oldTop = oldOffset.top;\n var newLeft = newOffset.left, newTop = newOffset.top;\n return Math.abs(oldLeft - newLeft) >= 1 || Math.abs(oldTop - newTop) >= 1;\n};\n/**\n * @hidden\n */\nexport var hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; };\n/**\n * @hidden\n */\nexport var FRAME_DURATION = 1000 / 60; // 1000ms divided by 60fps\n/**\n * @hidden\n */\nexport var throttle = function (func, wait, options) {\n if (options === void 0) { options = {}; }\n var timeout, context, args, result;\n var previous = 0;\n options = options || {};\n var later = function () {\n previous = options.leading === false ? 0 : new Date().getTime();\n timeout = undefined;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n };\n var throttled = function () {\n var now = new Date().getTime();\n if (!previous && options.leading === false) {\n previous = now;\n }\n var remaining = wait - (now - previous);\n context = undefined; // this\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n }\n else if (!timeout && options.trailing !== false) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n return throttled;\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-popup',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695800988,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport * as PropTypes from 'prop-types';\nimport { slide } from './animation';\nimport { canUseDOM, ZIndexContext, validatePackage, classNames } from '@progress/kendo-react-common';\nimport { AlignPoint, alignElement, domUtils, positionElement, Collision as CollisionEnum } from '@progress/kendo-popup-common';\nimport { throttle, FRAME_DURATION } from './util';\nimport { packageMetadata } from './package-metadata';\nvar DEFAULT_POPUP_ZINDEX = 100;\nvar ZINDEX_POPUP_STEP = 1;\nfunction isEquivalent(a, b) {\n if (a === b) {\n return true;\n }\n if (!!a !== !!b) {\n return false;\n }\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n if (aProps.length !== bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n return true;\n}\nvar DEFAULT_OFFSET = {\n left: -1000,\n top: 0\n};\nvar Status;\n(function (Status) {\n Status[\"hiding\"] = \"hiding\";\n Status[\"hidden\"] = \"hidden\";\n Status[\"showing\"] = \"showing\";\n Status[\"shown\"] = \"shown\";\n Status[\"reposition\"] = \"reposition\";\n})(Status || (Status = {}));\nvar ANIMATION_CONTAINER = 'k-animation-container';\nvar ANIMATION_CONTAINER_SHOWN = 'k-animation-container-shown';\nvar ANIMATION_CONTAINER_CHILD = 'k-child-animation-container';\nvar K_POPUP = 'k-popup';\n/**\n * @hidden\n */\nvar PopupWithoutContext = /** @class */ (function (_super) {\n __extends(PopupWithoutContext, _super);\n function PopupWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /**\n * @hidden\n */\n _this.context = 0;\n /**\n * @hidden\n */\n _this.state = { current: Status.hidden, previous: Status.hidden, props: {} };\n _this._popup = null;\n _this.show = function (popup) {\n _this.setPosition(popup);\n _this.animate(popup.firstChild, 'enter', _this.onOpened);\n _this.setState({ current: Status.shown, previous: _this.state.current });\n };\n _this.setPosition = function (popup) {\n var _a = _this.props, anchorAlign = _a.anchorAlign, popupAlign = _a.popupAlign, collision = _a.collision, offset = _a.offset, anchor = _a.anchor, margin = _a.margin, scale = _a.scale, positionMode = _a.positionMode;\n var _b = popup.style, width = _b.width, height = _b.height;\n // Calculations are wrong if popup does not have set size\n popup.style.width = popup.offsetWidth + 'px';\n popup.style.height = popup.offsetHeight + 'px';\n var alignedOffset = alignElement({\n anchor: anchor,\n anchorAlign: anchorAlign,\n element: popup,\n elementAlign: popupAlign,\n offset: offset,\n margin: margin,\n positionMode: positionMode,\n scale: scale\n });\n var position = positionElement({\n anchor: anchor,\n anchorAlign: anchorAlign,\n element: popup,\n elementAlign: popupAlign,\n collisions: collision,\n currentLocation: alignedOffset,\n margin: _this.props.margin\n });\n popup.style.top = position.offset.top + 'px';\n popup.style.left = position.offset.left + 'px';\n popup.style.width = width;\n popup.style.height = height;\n _this._collisions = {\n fit: position.fit,\n fitted: position.fitted,\n flip: position.flip,\n flipped: position.flipped\n };\n if (_this.props.onPosition) {\n var event_1 = {\n target: _this,\n flipped: position.flipped,\n fitted: position.fitted\n };\n _this.props.onPosition.call(undefined, event_1);\n }\n };\n _this.onOpened = function () {\n var element = _this._popup;\n if (!element) {\n return;\n }\n if (_this.props.show) {\n element.classList.add(ANIMATION_CONTAINER_SHOWN);\n }\n _this.attachRepositionHandlers(element);\n if (_this.props.onOpen) {\n _this.props.onOpen.call(undefined, { target: _this });\n }\n };\n _this.animate = function (element, type, callback) {\n if (!_this.props.popupAlign) {\n return;\n }\n var animationDirection;\n var _a = _this.props.popupAlign, horizontal = _a.horizontal, vertical = _a.vertical;\n if (horizontal === 'left' && vertical === 'center') {\n animationDirection = 'right';\n }\n else if (horizontal === 'right' && vertical === 'center') {\n animationDirection = 'left';\n }\n else if (vertical === 'top') {\n animationDirection = 'down';\n }\n else {\n animationDirection = 'up';\n }\n var flipPositions = {\n down: 'up',\n up: 'down',\n left: 'right',\n right: 'left'\n };\n if (_this._collisions && _this._collisions.flipped) {\n animationDirection = flipPositions[animationDirection];\n }\n slide(element, animationDirection, _this.animationDuration[type], type, callback);\n };\n _this.onClosing = function (popup) {\n if (!_this.props.show) {\n popup.classList.remove(ANIMATION_CONTAINER_SHOWN);\n }\n _this.detachRepositionHandlers();\n };\n _this.onClosed = function () {\n if (_this.state.current === Status.hiding && _this.state.previous === Status.shown) {\n _this.setState({ current: Status.hidden, previous: _this.state.current });\n }\n if (_this.props.onClose) {\n _this.props.onClose.call(undefined, { target: _this });\n }\n };\n _this.getCurrentZIndex = function () {\n return _this.context ? _this.context + ZINDEX_POPUP_STEP : DEFAULT_POPUP_ZINDEX;\n };\n validatePackage(packageMetadata);\n _this.reposition = throttle(_this.reposition.bind(_this), FRAME_DURATION);\n return _this;\n }\n Object.defineProperty(PopupWithoutContext.prototype, \"element\", {\n /**\n * Represents the Popup DOM element.\n */\n get: function () {\n return this._popup;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n PopupWithoutContext.getDerivedStateFromProps = function (props, state) {\n var show = props.show, anchor = props.anchor, anchorAlign = props.anchorAlign, appendTo = props.appendTo, collision = props.collision, popupAlign = props.popupAlign, className = props.className, popupClass = props.popupClass, style = props.style, offset = props.offset, contentKey = props.contentKey;\n var nextState = __assign(__assign({}, state), { props: {\n show: show,\n anchor: anchor,\n anchorAlign: anchorAlign,\n appendTo: appendTo,\n collision: collision,\n popupAlign: popupAlign,\n className: className,\n popupClass: popupClass,\n style: style,\n offset: offset,\n contentKey: contentKey\n } });\n if (props.show) {\n if (state.current === Status.hidden || state.current === Status.hiding) {\n return __assign(__assign({}, nextState), { current: Status.showing, previous: state.current });\n }\n if (state.current === Status.showing) {\n return __assign(__assign({}, nextState), { current: Status.shown, previous: state.current });\n }\n if (state.current === Status.shown &&\n (!isEquivalent(offset, state.props.offset) ||\n !isEquivalent(anchorAlign, state.props.anchorAlign) ||\n !isEquivalent(appendTo, state.props.appendTo) ||\n !isEquivalent(collision, state.props.collision) ||\n !isEquivalent(popupAlign, state.props.popupAlign) ||\n !isEquivalent(style, state.props.style) ||\n anchor !== state.props.anchor ||\n popupClass !== state.props.popupClass ||\n className !== state.props.className)) {\n return __assign(__assign({}, nextState), { current: Status.reposition, previous: state.current });\n }\n return nextState;\n }\n if (state.current === Status.hiding || state.current === Status.hidden) {\n return __assign(__assign({}, nextState), { current: Status.hidden, previous: state.current });\n }\n return __assign(__assign({}, nextState), { current: Status.hiding, previous: state.current });\n };\n /**\n * @hidden\n */\n PopupWithoutContext.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.current === Status.showing && this._popup) {\n this.show(this._popup);\n }\n else if (this.state.current === Status.hiding && this._popup) {\n this.onClosing(this._popup);\n this.animate(this._popup.firstChild, 'exit', this.onClosed);\n }\n else if (this.state.current === Status.reposition && this.state.previous === Status.shown) {\n this.setState({ current: Status.shown, previous: this.state.current });\n }\n else if (this.state.current === Status.shown &&\n prevProps.contentKey !== this.props.contentKey && this._popup) {\n this.setPosition(this._popup);\n }\n };\n /**\n * @hidden\n */\n PopupWithoutContext.prototype.componentDidMount = function () {\n if (this.state.current === Status.showing && this._popup) {\n this.show(this._popup);\n }\n };\n /**\n * @hidden\n */\n PopupWithoutContext.prototype.componentWillUnmount = function () {\n this.detachRepositionHandlers();\n };\n /**\n * @hidden\n */\n PopupWithoutContext.prototype.render = function () {\n var _this = this;\n var _a = this.props, children = _a.children, className = _a.className, popupClass = _a.popupClass, show = _a.show, id = _a.id, positionMode = _a.positionMode;\n var calculatedAppendTo = this.props.appendTo ?\n this.props.appendTo :\n canUseDOM ?\n (this.props.anchor && this.props.anchor.ownerDocument ? this.props.anchor.ownerDocument.body : document.body)\n : undefined;\n if (this.state.current === Status.reposition && this.state.previous === Status.shown && this._popup) {\n this.setPosition(this._popup);\n }\n var style = Object.assign({}, { position: positionMode, top: 0, left: -10000 }, this.props.style || {});\n var closing = this.state.current === Status.hiding;\n if ((show || closing) && calculatedAppendTo) {\n var currentZIndex = this.getCurrentZIndex();\n var popupElement = (React.createElement(ZIndexContext.Provider, { value: currentZIndex },\n React.createElement(\"div\", { className: classNames(ANIMATION_CONTAINER, className), id: id, ref: function (e) { return _this._popup = e; }, style: __assign({ zIndex: currentZIndex }, style) },\n React.createElement(\"div\", { className: classNames(ANIMATION_CONTAINER_CHILD), style: { transitionDelay: '0ms' } },\n React.createElement(\"div\", { role: this.props.role, className: classNames(K_POPUP, popupClass) }, children)))));\n return this.props.appendTo !== null ?\n ReactDOM.createPortal(popupElement, calculatedAppendTo) :\n popupElement;\n }\n return null;\n };\n Object.defineProperty(PopupWithoutContext.prototype, \"animationDuration\", {\n get: function () {\n var animate = this.props.animate;\n var enter = 0;\n var exit = 0;\n if (animate) {\n if (animate === true) {\n enter = exit = 300;\n }\n else {\n enter = animate.openDuration || 0;\n exit = animate.closeDuration || 0;\n }\n }\n return { enter: enter, exit: exit };\n },\n enumerable: false,\n configurable: true\n });\n PopupWithoutContext.prototype.attachRepositionHandlers = function (element) {\n var _this = this;\n this.detachRepositionHandlers();\n this._scrollableParents = domUtils.scrollableParents(this.props.anchor || element);\n if (this._scrollableParents) {\n this._scrollableParents.map(function (p) { return p.addEventListener('scroll', _this.reposition); });\n }\n window.addEventListener('resize', this.reposition);\n };\n PopupWithoutContext.prototype.detachRepositionHandlers = function () {\n var _this = this;\n if (this._scrollableParents) {\n this._scrollableParents.map(function (p) { return p.removeEventListener('scroll', _this.reposition); });\n this._scrollableParents = undefined;\n }\n window.removeEventListener('resize', this.reposition);\n };\n PopupWithoutContext.prototype.reposition = function () {\n this.setState({ current: Status.reposition, previous: this.state.current });\n };\n /**\n * @hidden\n */\n PopupWithoutContext.propTypes = {\n anchor: function (props) {\n var anchor = props.anchor;\n if (anchor && typeof anchor.nodeType !== 'number') {\n return new Error('Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed.');\n }\n return null;\n },\n appendTo: function (props) {\n var element = props.appendTo;\n if (element && typeof element.nodeType !== 'number') {\n return new Error('Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed.');\n }\n return null;\n },\n className: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.object\n ]),\n id: PropTypes.string,\n popupClass: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.object\n ]),\n collision: PropTypes.shape({\n horizontal: PropTypes.oneOf([\n CollisionEnum.fit,\n CollisionEnum.flip,\n CollisionEnum.none\n ]),\n vertical: PropTypes.oneOf([\n CollisionEnum.fit,\n CollisionEnum.flip,\n CollisionEnum.none\n ])\n }),\n anchorAlign: PropTypes.shape({\n horizontal: PropTypes.oneOf([\n AlignPoint.left,\n AlignPoint.center,\n AlignPoint.right\n ]),\n vertical: PropTypes.oneOf([\n AlignPoint.top,\n AlignPoint.center,\n AlignPoint.bottom\n ])\n }),\n popupAlign: PropTypes.shape({\n horizontal: PropTypes.oneOf([\n AlignPoint.left,\n AlignPoint.center,\n AlignPoint.right\n ]),\n vertical: PropTypes.oneOf([\n AlignPoint.top,\n AlignPoint.center,\n AlignPoint.bottom\n ])\n }),\n offset: PropTypes.shape({\n left: PropTypes.number,\n top: PropTypes.number\n }),\n children: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.node\n ]),\n show: PropTypes.bool,\n animate: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n openDuration: PropTypes.number,\n closeDuration: PropTypes.number\n })\n ]),\n margin: PropTypes.shape({\n horizontal: PropTypes.number,\n vertical: PropTypes.number\n }),\n positionMode: PropTypes.oneOf([\n 'fixed',\n 'absolute'\n ]),\n scale: PropTypes.number,\n style: PropTypes.object,\n onClose: PropTypes.func,\n onPosition: PropTypes.func,\n onOpen: PropTypes.func\n };\n /**\n * @hidden\n */\n PopupWithoutContext.defaultProps = {\n collision: {\n horizontal: CollisionEnum.fit,\n vertical: CollisionEnum.flip\n },\n anchorAlign: {\n horizontal: AlignPoint.left,\n vertical: AlignPoint.bottom\n },\n popupAlign: {\n horizontal: AlignPoint.left,\n vertical: AlignPoint.top\n },\n offset: DEFAULT_OFFSET,\n animate: true,\n show: false,\n margin: {\n horizontal: 0,\n vertical: 0\n },\n positionMode: 'absolute'\n };\n /**\n * @hidden\n */\n PopupWithoutContext.contextType = ZIndexContext;\n /**\n * @hidden\n */\n PopupWithoutContext.displayName = 'PopupComponent';\n return PopupWithoutContext;\n}(React.Component));\nexport { PopupWithoutContext };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { PopupWithoutContext } from './PopupWithoutContext';\n/**\n * The PopupPropsContext. It allows to configure the Popup props from a wrapper component.\n *\n * @example\n * ```jsx-no-run\n * ({ ...props, appendTo: document.querySelector('myPopupsContainer') })}>\n * \n * \n * \n * ```\n */\nexport var PopupPropsContext = React.createContext(function (props) { return props; });\n/**\n * The KendoReact Popup component.\n */\nexport var Popup = React.forwardRef(function (props, ref) {\n var contextPropsCallback = React.useContext(PopupPropsContext);\n var popupProps = contextPropsCallback.call(undefined, props);\n return (React.createElement(PopupWithoutContext, __assign({ ref: ref }, popupProps)));\n});\nPopup.displayName = 'Popup';\n","const caretTrIcon = {\n name: 'caret-tr',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretBrIcon = {\n name: 'caret-br',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretBlIcon = {\n name: 'caret-bl',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretTlIcon = {\n name: 'caret-tl',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltUpIcon = {\n name: 'caret-alt-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltRightIcon = {\n name: 'caret-alt-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltDownIcon = {\n name: 'caret-alt-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltLeftIcon = {\n name: 'caret-alt-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltToTopIcon = {\n name: 'caret-alt-to-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltToRightIcon = {\n name: 'caret-alt-to-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltToBottomIcon = {\n name: 'caret-alt-to-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltToLeftIcon = {\n name: 'caret-alt-to-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretDoubleAltUpIcon = {\n name: 'caret-double-alt-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretDoubleAltRightIcon = {\n name: 'caret-double-alt-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretDoubleAltDownIcon = {\n name: 'caret-double-alt-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretDoubleAltLeftIcon = {\n name: 'caret-double-alt-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst caretAltExpandIcon = {\n name: 'caret-alt-expand',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsNoChangeIcon = {\n name: 'arrows-no-change',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowOverflowDownIcon = {\n name: 'arrow-overflow-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronUpIcon = {\n name: 'chevron-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronRightIcon = {\n name: 'chevron-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronDownIcon = {\n name: 'chevron-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronLeftIcon = {\n name: 'chevron-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowUpIcon = {\n name: 'arrow-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowRightIcon = {\n name: 'arrow-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowDownIcon = {\n name: 'arrow-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowLeftIcon = {\n name: 'arrow-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst levelDownIcon = {\n name: 'level-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst levelUpIcon = {\n name: 'level-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst levelToTopIcon = {\n name: 'level-to-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst colResizeIcon = {\n name: 'col-resize',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsAxesIcon = {\n name: 'arrows-axes',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsSwapIcon = {\n name: 'arrows-swap',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dragAndDropIcon = {\n name: 'drag-and-drop',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst categorizeIcon = {\n name: 'categorize',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gridIcon = {\n name: 'grid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gridLayoutIcon = {\n name: 'grid-layout',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupIcon = {\n name: 'group',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst ungroupIcon = {\n name: 'ungroup',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst handleDragIcon = {\n name: 'handle-drag',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst layoutIcon = {\n name: 'layout',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst layout1By4Icon = {\n name: 'layout-1-by-4',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst layout2By2Icon = {\n name: 'layout-2-by-2',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst layoutSideBySideIcon = {\n name: 'layout-side-by-side',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst layoutStackedIcon = {\n name: 'layout-stacked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst columnsIcon = {\n name: 'columns',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rowsIcon = {\n name: 'rows',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst reorderIcon = {\n name: 'reorder',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst menuIcon = {\n name: 'menu',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst moreVerticalIcon = {\n name: 'more-vertical',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst moreHorizontalIcon = {\n name: 'more-horizontal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst overlapIcon = {\n name: 'overlap',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst homeIcon = {\n name: 'home',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsLeftRightIcon = {\n name: 'arrows-left-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsTopBottomIcon = {\n name: 'arrows-top-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRadiusBottomLeftIcon = {\n name: 'border-radius-bottom-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRadiusBottomRightIcon = {\n name: 'border-radius-bottom-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRadiusTopLeftIcon = {\n name: 'border-radius-top-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRadiusTopRightIcon = {\n name: 'border-radius-top-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRadiusIcon = {\n name: 'border-radius',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderStyleBottomIcon = {\n name: 'border-style-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderStyleLeftIcon = {\n name: 'border-style-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderStyleRightIcon = {\n name: 'border-style-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderStyleTopIcon = {\n name: 'border-style-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderStyleIcon = {\n name: 'border-style',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst boxSizingIcon = {\n name: 'box-sizing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronDoubleDownIcon = {\n name: 'chevron-double-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronDoubleLeftIcon = {\n name: 'chevron-double-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronDoubleRightIcon = {\n name: 'chevron-double-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chevronDoubleUpIcon = {\n name: 'chevron-double-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataOdsIcon = {\n name: 'data-ods',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst nonRecurrenceIcon = {\n name: 'non-recurrence',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst displayBlockIcon = {\n name: 'display-block',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst displayFlexIcon = {\n name: 'display-flex',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst displayInlineFlexIcon = {\n name: 'display-inline-flex',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dropletSliderIcon = {\n name: 'droplet-slider',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileReportIcon = {\n name: 'file-report',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gapColumnIcon = {\n name: 'gap-column',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gapRowIcon = {\n name: 'gap-row',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst handleResizeAltIcon = {\n name: 'handle-resize-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst handleResizeIcon = {\n name: 'handle-resize',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imagesIcon = {\n name: 'images',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst letterSpaceIcon = {\n name: 'letter-space',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst lineHeightIcon = {\n name: 'line-height',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listLatinBigIcon = {\n name: 'list-latin-big',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listLatinSmallIcon = {\n name: 'list-latin-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listRomanBigIcon = {\n name: 'list-roman-big',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listRomanSmallIcon = {\n name: 'list-roman-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listUnorderedOutlineIcon = {\n name: 'list-unordered-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listUnorderedSquareIcon = {\n name: 'list-unordered-square',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst maxHeightIcon = {\n name: 'max-height',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst maxWidthIcon = {\n name: 'max-width',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minHeightIcon = {\n name: 'min-height',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minWidthIcon = {\n name: 'min-width',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst outlineOffsetIcon = {\n name: 'outline-offset',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst outlineWidthIcon = {\n name: 'outline-width',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paddingBottomIcon = {\n name: 'padding-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paddingLeftIcon = {\n name: 'padding-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paddingRightIcon = {\n name: 'padding-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paddingTopIcon = {\n name: 'padding-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paddingIcon = {\n name: 'padding',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst positionBottomIcon = {\n name: 'position-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst positionLeftIcon = {\n name: 'position-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst positionRightIcon = {\n name: 'position-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst positionTopIcon = {\n name: 'position-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst regularExpressionIcon = {\n name: 'regular-expression',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst replaceAllIcon = {\n name: 'replace-all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst replaceSingleIcon = {\n name: 'replace-single',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst reportElementIcon = {\n name: 'report-element',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rightDoubleQuotesIcon = {\n name: 'right-double-quotes',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst wholeWordIcon = {\n name: 'whole-word',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataSdsIcon = {\n name: 'data-sds',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst downloadLightIcon = {\n name: 'download-light',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst eyeSlashIcon = {\n name: 'eye-slash',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst displayInlineBlockIcon = {\n name: 'display-inline-block',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paperPlaneIcon = {\n name: 'paper-plane',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gaugeLinearIcon = {\n name: 'gauge-linear',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gaugeRadialIcon = {\n name: 'gauge-radial',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopeBoxIcon = {\n name: 'envelope-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopeLinkIcon = {\n name: 'envelope-link',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopeIcon = {\n name: 'envelope',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst warningCircleIcon = {\n name: 'warning-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst warningTriangleIcon = {\n name: 'warning-triangle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst infoSolidIcon = {\n name: 'info-solid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fontGrowIcon = {\n name: 'font-grow',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fontShrinkIcon = {\n name: 'font-shrink',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textOverflowIcon = {\n name: 'text-overflow',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textWrapArrowIcon = {\n name: 'text-wrap-arrow',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textTruncateIcon = {\n name: 'text-truncate',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textClipIcon = {\n name: 'text-clip',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderColorIcon = {\n name: 'border-color',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderTypeIcon = {\n name: 'border-type',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbDownOutlineIcon = {\n name: 'thumb-down-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbDownIcon = {\n name: 'thumb-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbUpOutlineIcon = {\n name: 'thumb-up-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbUpIcon = {\n name: 'thumb-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sparklesIcon = {\n name: 'sparkles',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paragraphMarkIcon = {\n name: 'paragraph-mark',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paragraphHeightIcon = {\n name: 'paragraph-height',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst userOutlineIcon = {\n name: 'user-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst walletSolidIcon = {\n name: 'wallet-solid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stampIcon = {\n name: 'stamp',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stickyNoteIcon = {\n name: 'sticky-note',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rulerOutlineIcon = {\n name: 'ruler-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst eraserOutlineIcon = {\n name: 'eraser-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst editAnnotationsIcon = {\n name: 'edit-annotations',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst highlightIcon = {\n name: 'highlight',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst highlightFreeIcon = {\n name: 'highlight-free',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst freeTextIcon = {\n name: 'free-text',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst xLogoIcon = {\n name: 'x-logo',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst undoIcon = {\n name: 'undo',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst redoIcon = {\n name: 'redo',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowRotateCcwIcon = {\n name: 'arrow-rotate-ccw',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowRotateCwIcon = {\n name: 'arrow-rotate-cw',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsNoRepeatIcon = {\n name: 'arrows-no-repeat',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowRotateCcwSmallIcon = {\n name: 'arrow-rotate-ccw-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowRotateCwSmallIcon = {\n name: 'arrow-rotate-cw-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clockIcon = {\n name: 'clock',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst calendarIcon = {\n name: 'calendar',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst saveIcon = {\n name: 'save',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst printIcon = {\n name: 'print',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pencilIcon = {\n name: 'pencil',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trashIcon = {\n name: 'trash',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paperclipIcon = {\n name: 'paperclip',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paperclipAltIcon = {\n name: 'paperclip-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst linkIcon = {\n name: 'link',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst unlinkIcon = {\n name: 'unlink',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst linkVerticalIcon = {\n name: 'link-vertical',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst unlinkVerticalIcon = {\n name: 'unlink-vertical',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst lockIcon = {\n name: 'lock',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst unlockIcon = {\n name: 'unlock',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cancelIcon = {\n name: 'cancel',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cancelOutlineIcon = {\n name: 'cancel-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cancelCircleIcon = {\n name: 'cancel-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkIcon = {\n name: 'check',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkOutlineIcon = {\n name: 'check-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkCircleIcon = {\n name: 'check-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst xIcon = {\n name: 'x',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst xOutlineIcon = {\n name: 'x-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst xCircleIcon = {\n name: 'x-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst plusIcon = {\n name: 'plus',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst plusOutlineIcon = {\n name: 'plus-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst plusCircleIcon = {\n name: 'plus-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minusIcon = {\n name: 'minus',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minusOutlineIcon = {\n name: 'minus-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minusCircleIcon = {\n name: 'minus-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sortAscIcon = {\n name: 'sort-asc',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sortDescIcon = {\n name: 'sort-desc',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sortClearIcon = {\n name: 'sort-clear',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sortAscSmallIcon = {\n name: 'sort-asc-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sortDescSmallIcon = {\n name: 'sort-desc-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterIcon = {\n name: 'filter',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterClearIcon = {\n name: 'filter-clear',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterSmallIcon = {\n name: 'filter-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterSortAscSmallIcon = {\n name: 'filter-sort-asc-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterSortDescSmallIcon = {\n name: 'filter-sort-desc-small',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterAddExpressionIcon = {\n name: 'filter-add-expression',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filterAddGroupIcon = {\n name: 'filter-add-group',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst loginIcon = {\n name: 'login',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst logoutIcon = {\n name: 'logout',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst downloadIcon = {\n name: 'download',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst uploadIcon = {\n name: 'upload',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst hyperlinkOpenIcon = {\n name: 'hyperlink-open',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst hyperlinkOpenSmIcon = {\n name: 'hyperlink-open-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst launchIcon = {\n name: 'launch',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst windowIcon = {\n name: 'window',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst windowRestoreIcon = {\n name: 'window-restore',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst windowMinimizeIcon = {\n name: 'window-minimize',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gearIcon = {\n name: 'gear',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst gearsIcon = {\n name: 'gears',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst wrenchIcon = {\n name: 'wrench',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst eyeIcon = {\n name: 'eye',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst searchIcon = {\n name: 'search',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst zoomInIcon = {\n name: 'zoom-in',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst zoomOutIcon = {\n name: 'zoom-out',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst arrowsMoveIcon = {\n name: 'arrows-move',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst calculatorIcon = {\n name: 'calculator',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cartIcon = {\n name: 'cart',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst connectorIcon = {\n name: 'connector',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst plusSmIcon = {\n name: 'plus-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst minusSmIcon = {\n name: 'minus-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst kpiStatusDenyIcon = {\n name: 'kpi-status-deny',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst kpiStatusHoldIcon = {\n name: 'kpi-status-hold',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst kpiStatusOpenIcon = {\n name: 'kpi-status-open',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst equalIcon = {\n name: 'equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst notEqualIcon = {\n name: 'not-equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst lessOrEqualIcon = {\n name: 'less-or-equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst greaterOrEqualIcon = {\n name: 'greater-or-equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst divideIcon = {\n name: 'divide',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst accessibilityIcon = {\n name: 'accessibility',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst barcodeOutlineIcon = {\n name: 'barcode-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst barcodeIcon = {\n name: 'barcode',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst barcodeScannerIcon = {\n name: 'barcode-scanner',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst qrCodeOutlineIcon = {\n name: 'qr-code-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst qrCodeIcon = {\n name: 'qr-code',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst qrCodeScannerIcon = {\n name: 'qr-code-scanner',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst barcodeQrCodeScannerIcon = {\n name: 'barcode-qr-code-scanner',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst signatureIcon = {\n name: 'signature',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst handIcon = {\n name: 'hand',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pointerIcon = {\n name: 'pointer',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stickIcon = {\n name: 'stick',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst unstickIcon = {\n name: 'unstick',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst setColumnPositionIcon = {\n name: 'set-column-position',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clockArrowRotateIcon = {\n name: 'clock-arrow-rotate',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst playIcon = {\n name: 'play',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pauseIcon = {\n name: 'pause',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stopIcon = {\n name: 'stop',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rewindIcon = {\n name: 'rewind',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst forwardIcon = {\n name: 'forward',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst volumeDownIcon = {\n name: 'volume-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst volumeUpIcon = {\n name: 'volume-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst volumeMuteIcon = {\n name: 'volume-mute',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst hdIcon = {\n name: 'hd',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst closedCaptionsIcon = {\n name: 'closed-captions',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst playlistIcon = {\n name: 'playlist',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst musicNotesIcon = {\n name: 'music-notes',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst playSmIcon = {\n name: 'play-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pauseSmIcon = {\n name: 'pause-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stopSmIcon = {\n name: 'stop-sm',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst heartOutlineIcon = {\n name: 'heart-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst heartIcon = {\n name: 'heart',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst starOutlineIcon = {\n name: 'star-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst starIcon = {\n name: 'star',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkboxIcon = {\n name: 'checkbox',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkboxCheckedIcon = {\n name: 'checkbox-checked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkboxIndeterminateIcon = {\n name: 'checkbox-indeterminate',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst checkboxNullIcon = {\n name: 'checkbox-null',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst circleIcon = {\n name: 'circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst radiobuttonIcon = {\n name: 'radiobutton',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst radiobuttonCheckedIcon = {\n name: 'radiobutton-checked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bellIcon = {\n name: 'bell',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst infoCircleIcon = {\n name: 'info-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst questionCircleIcon = {\n name: 'question-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst exclamationCircleIcon = {\n name: 'exclamation-circle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cameraIcon = {\n name: 'camera',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageIcon = {\n name: 'image',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageExportIcon = {\n name: 'image-export',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst zoomActualSizeIcon = {\n name: 'zoom-actual-size',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst zoomBestFitIcon = {\n name: 'zoom-best-fit',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageResizeIcon = {\n name: 'image-resize',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cropIcon = {\n name: 'crop',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst mirrorIcon = {\n name: 'mirror',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst flipHorizontalIcon = {\n name: 'flip-horizontal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst flipVerticalIcon = {\n name: 'flip-vertical',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rotateIcon = {\n name: 'rotate',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rotateRightIcon = {\n name: 'rotate-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rotateLeftIcon = {\n name: 'rotate-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst brushIcon = {\n name: 'brush',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paletteIcon = {\n name: 'palette',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dropletIcon = {\n name: 'droplet',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst shapeLineIcon = {\n name: 'shape-line',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst brightnessContrastIcon = {\n name: 'brightness-contrast',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst slidersIcon = {\n name: 'sliders',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst invertColorsIcon = {\n name: 'invert-colors',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst transparencyIcon = {\n name: 'transparency',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst grayscaleIcon = {\n name: 'grayscale',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst blurIcon = {\n name: 'blur',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sharpenIcon = {\n name: 'sharpen',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst shapesIcon = {\n name: 'shapes',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst roundCornersIcon = {\n name: 'round-corners',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bringToFrontIcon = {\n name: 'bring-to-front',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bringToBackIcon = {\n name: 'bring-to-back',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bringForwardIcon = {\n name: 'bring-forward',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bringBackwardIcon = {\n name: 'bring-backward',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfStartIcon = {\n name: 'align-self-start',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfCenterIcon = {\n name: 'align-self-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfEndIcon = {\n name: 'align-self-end',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfStartAltIcon = {\n name: 'align-self-start-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfCenterAltIcon = {\n name: 'align-self-center-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfEndAltIcon = {\n name: 'align-self-end-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbnailsUpIcon = {\n name: 'thumbnails-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbnailsRightIcon = {\n name: 'thumbnails-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbnailsDownIcon = {\n name: 'thumbnails-down',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst thumbnailsLeftIcon = {\n name: 'thumbnails-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fullscreenIcon = {\n name: 'fullscreen',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fullscreenExitIcon = {\n name: 'fullscreen-exit',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dropletSlashIcon = {\n name: 'droplet-slash',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst photosIcon = {\n name: 'photos',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignToGridIcon = {\n name: 'align-to-grid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sizeToGridIcon = {\n name: 'size-to-grid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst makeSameSizeIcon = {\n name: 'make-same-size',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst makeSameWidthIcon = {\n name: 'make-same-width',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst makeSameHeightIcon = {\n name: 'make-same-height',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst makeHorizontalSpacingEqualIcon = {\n name: 'make-horizontal-spacing-equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst increaseHorizontalSpacingIcon = {\n name: 'increase-horizontal-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst decreaseHorizontalSpacingIcon = {\n name: 'decrease-horizontal-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst removeHorizontalSpacingIcon = {\n name: 'remove-horizontal-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst makeVerticalSpacingEqualIcon = {\n name: 'make-vertical-spacing-equal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst increaseVerticalSpacingIcon = {\n name: 'increase-vertical-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst decreaseVerticalSpacingIcon = {\n name: 'decrease-vertical-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst removeVerticalSpacingIcon = {\n name: 'remove-vertical-spacing',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst eyedropperIcon = {\n name: 'eyedropper',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst snapGridIcon = {\n name: 'snap-grid',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst snapToGridlinesIcon = {\n name: 'snap-to-gridlines',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst snapToSnaplinesIcon = {\n name: 'snap-to-snaplines',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dimensionsIcon = {\n name: 'dimensions',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfStretchIcon = {\n name: 'align-self-stretch',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignSelfStretchAltIcon = {\n name: 'align-self-stretch-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsStartIcon = {\n name: 'align-items-start',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsCenterIcon = {\n name: 'align-items-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsEndIcon = {\n name: 'align-items-end',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsStretchIcon = {\n name: 'align-items-stretch',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsBaselineIcon = {\n name: 'align-items-baseline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsStartAltIcon = {\n name: 'align-items-start-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsCenterAltIcon = {\n name: 'align-items-center-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsEndAltIcon = {\n name: 'align-items-end-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsStretchAltIcon = {\n name: 'align-items-stretch-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignItemsBaselineAltIcon = {\n name: 'align-items-baseline-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentStartIcon = {\n name: 'justify-content-start',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentCenterIcon = {\n name: 'justify-content-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentEndIcon = {\n name: 'justify-content-end',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentBetweenIcon = {\n name: 'justify-content-between',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentAroundIcon = {\n name: 'justify-content-around',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentStartAltIcon = {\n name: 'justify-content-start-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentCenterAltIcon = {\n name: 'justify-content-center-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentEndAltIcon = {\n name: 'justify-content-end-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentBetweenAltIcon = {\n name: 'justify-content-between-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst justifyContentAroundAltIcon = {\n name: 'justify-content-around-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileWrenchIcon = {\n name: 'file-wrench',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst boldIcon = {\n name: 'bold',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst italicIcon = {\n name: 'italic',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst underlineIcon = {\n name: 'underline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fontFamilyIcon = {\n name: 'font-family',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst foregroundColorIcon = {\n name: 'foreground-color',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst convertLowercaseIcon = {\n name: 'convert-lowercase',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst convertUppercaseIcon = {\n name: 'convert-uppercase',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst strikethroughIcon = {\n name: 'strikethrough',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst subscriptIcon = {\n name: 'subscript',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst supscriptIcon = {\n name: 'supscript',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst divIcon = {\n name: 'div',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst allIcon = {\n name: 'all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h1Icon = {\n name: 'h1',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h2Icon = {\n name: 'h2',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h3Icon = {\n name: 'h3',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h4Icon = {\n name: 'h4',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h5Icon = {\n name: 'h5',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst h6Icon = {\n name: 'h6',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listOrderedIcon = {\n name: 'list-ordered',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listUnorderedIcon = {\n name: 'list-unordered',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst indentIcon = {\n name: 'indent',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst outdentIcon = {\n name: 'outdent',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst insertTopIcon = {\n name: 'insert-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst insertMiddleIcon = {\n name: 'insert-middle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst insertBottomIcon = {\n name: 'insert-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignTopIcon = {\n name: 'align-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignMiddleIcon = {\n name: 'align-middle',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignBottomIcon = {\n name: 'align-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignLeftIcon = {\n name: 'align-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignCenterIcon = {\n name: 'align-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignRightIcon = {\n name: 'align-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignJustifyIcon = {\n name: 'align-justify',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst alignRemoveIcon = {\n name: 'align-remove',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textWrapIcon = {\n name: 'text-wrap',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst horizontalRuleIcon = {\n name: 'horizontal-rule',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignTopLeftIcon = {\n name: 'table-align-top-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignTopCenterIcon = {\n name: 'table-align-top-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignTopRightIcon = {\n name: 'table-align-top-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignMiddleLeftIcon = {\n name: 'table-align-middle-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignMiddleCenterIcon = {\n name: 'table-align-middle-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignMiddleRightIcon = {\n name: 'table-align-middle-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignBottomLeftIcon = {\n name: 'table-align-bottom-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignBottomCenterIcon = {\n name: 'table-align-bottom-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignBottomRightIcon = {\n name: 'table-align-bottom-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAlignRemoveIcon = {\n name: 'table-align-remove',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersAllIcon = {\n name: 'borders-all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersOutsideIcon = {\n name: 'borders-outside',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersInsideIcon = {\n name: 'borders-inside',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersInsideHorizontalIcon = {\n name: 'borders-inside-horizontal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersInsideVerticalIcon = {\n name: 'borders-inside-vertical',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderTopIcon = {\n name: 'border-top',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderBottomIcon = {\n name: 'border-bottom',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderLeftIcon = {\n name: 'border-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst borderRightIcon = {\n name: 'border-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersNoneIcon = {\n name: 'borders-none',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bordersShowHideIcon = {\n name: 'borders-show-hide',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst formIcon = {\n name: 'form',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst formElementIcon = {\n name: 'form-element',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst codeSnippetIcon = {\n name: 'code-snippet',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst selectAllIcon = {\n name: 'select-all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst buttonIcon = {\n name: 'button',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst selectBoxIcon = {\n name: 'select-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst calendarDateIcon = {\n name: 'calendar-date',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupBoxIcon = {\n name: 'group-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textareaIcon = {\n name: 'textarea',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textboxIcon = {\n name: 'textbox',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst textboxHiddenIcon = {\n name: 'textbox-hidden',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst passwordIcon = {\n name: 'password',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paragraphAddIcon = {\n name: 'paragraph-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst editToolsIcon = {\n name: 'edit-tools',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst templateManagerIcon = {\n name: 'template-manager',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst changeManuallyIcon = {\n name: 'change-manually',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesIcon = {\n name: 'track-changes',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesEnableIcon = {\n name: 'track-changes-enable',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesAcceptIcon = {\n name: 'track-changes-accept',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesAcceptAllIcon = {\n name: 'track-changes-accept-all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesRejectIcon = {\n name: 'track-changes-reject',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst trackChangesRejectAllIcon = {\n name: 'track-changes-reject-all',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst documentManagerIcon = {\n name: 'document-manager',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst customIconIcon = {\n name: 'custom-icon',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bookIcon = {\n name: 'book',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageAddIcon = {\n name: 'image-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageEditIcon = {\n name: 'image-edit',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageMapEditorIcon = {\n name: 'image-map-editor',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst commentIcon = {\n name: 'comment',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst commentRemoveIcon = {\n name: 'comment-remove',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst commentsRemoveIcon = {\n name: 'comments-remove',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst silverlightIcon = {\n name: 'silverlight',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst mediaManagerIcon = {\n name: 'media-manager',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst videoExternalIcon = {\n name: 'video-external',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst flashManagerIcon = {\n name: 'flash-manager',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst binocularsIcon = {\n name: 'binoculars',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst copyIcon = {\n name: 'copy',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cutIcon = {\n name: 'cut',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardIcon = {\n name: 'clipboard',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardCodeIcon = {\n name: 'clipboard-code',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardWordIcon = {\n name: 'clipboard-word',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardWordAltIcon = {\n name: 'clipboard-word-alt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardHtmlIcon = {\n name: 'clipboard-html',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardMarkdownIcon = {\n name: 'clipboard-markdown',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clipboardTextIcon = {\n name: 'clipboard-text',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst applyFormatIcon = {\n name: 'apply-format',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst clearCssIcon = {\n name: 'clear-css',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst copyFormatIcon = {\n name: 'copy-format',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stripAllFormattingIcon = {\n name: 'strip-all-formatting',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stripCssFormatIcon = {\n name: 'strip-css-format',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stripFontElementsIcon = {\n name: 'strip-font-elements',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stripSpanElementsIcon = {\n name: 'strip-span-elements',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stripWordFormattingIcon = {\n name: 'strip-word-formatting',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst formatCodeBlockIcon = {\n name: 'format-code-block',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst buildingBlocksIcon = {\n name: 'building-blocks',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst puzzlePieceIcon = {\n name: 'puzzle-piece',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst linkAddIcon = {\n name: 'link-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst globeLinkIcon = {\n name: 'globe-link',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst globeUnlinkIcon = {\n name: 'globe-unlink',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopLinkIcon = {\n name: 'envelop-link',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst anchorIcon = {\n name: 'anchor',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableAddIcon = {\n name: 'table-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableIcon = {\n name: 'table',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tablePropertiesIcon = {\n name: 'table-properties',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableCellIcon = {\n name: 'table-cell',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableCellPropertiesIcon = {\n name: 'table-cell-properties',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableColumnInsertLeftIcon = {\n name: 'table-column-insert-left',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableColumnInsertRightIcon = {\n name: 'table-column-insert-right',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableRowInsertAboveIcon = {\n name: 'table-row-insert-above',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableRowInsertBelowIcon = {\n name: 'table-row-insert-below',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableColumnDeleteIcon = {\n name: 'table-column-delete',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableRowDeleteIcon = {\n name: 'table-row-delete',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableCellDeleteIcon = {\n name: 'table-cell-delete',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableDeleteIcon = {\n name: 'table-delete',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cellsMergeIcon = {\n name: 'cells-merge',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cellsMergeHorizontallyIcon = {\n name: 'cells-merge-horizontally',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cellsMergeVerticallyIcon = {\n name: 'cells-merge-vertically',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cellSplitHorizontallyIcon = {\n name: 'cell-split-horizontally',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cellSplitVerticallyIcon = {\n name: 'cell-split-vertically',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableUnmergeIcon = {\n name: 'table-unmerge',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst paneFreezeIcon = {\n name: 'pane-freeze',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rowFreezeIcon = {\n name: 'row-freeze',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst columnFreezeIcon = {\n name: 'column-freeze',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst toolbarFloatIcon = {\n name: 'toolbar-float',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst spellCheckerIcon = {\n name: 'spell-checker',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst validationXhtmlIcon = {\n name: 'validation-xhtml',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst validationDataIcon = {\n name: 'validation-data',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst toggleFullScreenModeIcon = {\n name: 'toggle-full-screen-mode',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst formulaFxIcon = {\n name: 'formula-fx',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst sumIcon = {\n name: 'sum',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst symbolIcon = {\n name: 'symbol',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dollarIcon = {\n name: 'dollar',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst percentIcon = {\n name: 'percent',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst customFormatIcon = {\n name: 'custom-format',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst decimalIncreaseIcon = {\n name: 'decimal-increase',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst decimalDecreaseIcon = {\n name: 'decimal-decrease',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fontSizeIcon = {\n name: 'font-size',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst imageAbsolutePositionIcon = {\n name: 'image-absolute-position',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableWizardIcon = {\n name: 'table-wizard',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst crosstabIcon = {\n name: 'crosstab',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst crosstabWizardIcon = {\n name: 'crosstab-wizard',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableBodyIcon = {\n name: 'table-body',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableColumnGroupsIcon = {\n name: 'table-column-groups',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableCornerIcon = {\n name: 'table-corner',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tableRowGroupsIcon = {\n name: 'table-row-groups',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst globeOutlineIcon = {\n name: 'globe-outline',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst globeIcon = {\n name: 'globe',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst mapMarkerIcon = {\n name: 'map-marker',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst mapMarkerTargetIcon = {\n name: 'map-marker-target',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pinIcon = {\n name: 'pin',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst unpinIcon = {\n name: 'unpin',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst shareIcon = {\n name: 'share',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst userIcon = {\n name: 'user',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst inboxIcon = {\n name: 'inbox',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bloggerIcon = {\n name: 'blogger',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst bloggerBoxIcon = {\n name: 'blogger-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst deliciousIcon = {\n name: 'delicious',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst deliciousBoxIcon = {\n name: 'delicious-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst diggIcon = {\n name: 'digg',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst diggBoxIcon = {\n name: 'digg-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopIcon = {\n name: 'envelop',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst envelopBoxIcon = {\n name: 'envelop-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst facebookIcon = {\n name: 'facebook',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst facebookBoxIcon = {\n name: 'facebook-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst googleIcon = {\n name: 'google',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst googleBoxIcon = {\n name: 'google-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst googlePlusIcon = {\n name: 'google-plus',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst googlePlusBoxIcon = {\n name: 'google-plus-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst linkedinIcon = {\n name: 'linkedin',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst linkedinBoxIcon = {\n name: 'linkedin-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst myspaceIcon = {\n name: 'myspace',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst myspaceBoxIcon = {\n name: 'myspace-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pinterestIcon = {\n name: 'pinterest',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pinterestBoxIcon = {\n name: 'pinterest-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst redditIcon = {\n name: 'reddit',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst redditBoxIcon = {\n name: 'reddit-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stumbleUponIcon = {\n name: 'stumble-upon',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst stumbleUponBoxIcon = {\n name: 'stumble-upon-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tellAFriendIcon = {\n name: 'tell-a-friend',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tellAFriendBoxIcon = {\n name: 'tell-a-friend-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tumblrIcon = {\n name: 'tumblr',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tumblrBoxIcon = {\n name: 'tumblr-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst twitterIcon = {\n name: 'twitter',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst twitterBoxIcon = {\n name: 'twitter-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst yammerIcon = {\n name: 'yammer',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst yammerBoxIcon = {\n name: 'yammer-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst behanceIcon = {\n name: 'behance',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst behanceBoxIcon = {\n name: 'behance-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dribbbleIcon = {\n name: 'dribbble',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dribbbleBoxIcon = {\n name: 'dribbble-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rssIcon = {\n name: 'rss',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst rssBoxIcon = {\n name: 'rss-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst vimeoIcon = {\n name: 'vimeo',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst vimeoBoxIcon = {\n name: 'vimeo-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst youtubeIcon = {\n name: 'youtube',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst youtubeBoxIcon = {\n name: 'youtube-box',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst folderIcon = {\n name: 'folder',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst folderOpenIcon = {\n name: 'folder-open',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst folderAddIcon = {\n name: 'folder-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst folderUpIcon = {\n name: 'folder-up',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst folderMoreIcon = {\n name: 'folder-more',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst aggregateFieldsIcon = {\n name: 'aggregate-fields',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileIcon = {\n name: 'file',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileAddIcon = {\n name: 'file-add',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileTxtIcon = {\n name: 'file-txt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileCsvIcon = {\n name: 'file-csv',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileExcelIcon = {\n name: 'file-excel',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileWordIcon = {\n name: 'file-word',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileMdbIcon = {\n name: 'file-mdb',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filePptIcon = {\n name: 'file-ppt',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filePdfIcon = {\n name: 'file-pdf',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filePsdIcon = {\n name: 'file-psd',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileFlashIcon = {\n name: 'file-flash',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileConfigIcon = {\n name: 'file-config',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileAscxIcon = {\n name: 'file-ascx',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileBacIcon = {\n name: 'file-bac',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileZipIcon = {\n name: 'file-zip',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filmIcon = {\n name: 'film',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst css3Icon = {\n name: 'css3',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst html5Icon = {\n name: 'html5',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst codeIcon = {\n name: 'code',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cssIcon = {\n name: 'css',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst jsIcon = {\n name: 'js',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst exeIcon = {\n name: 'exe',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst csprojIcon = {\n name: 'csproj',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst vbprojIcon = {\n name: 'vbproj',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst csIcon = {\n name: 'cs',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst vbIcon = {\n name: 'vb',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst slnIcon = {\n name: 'sln',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst cloudIcon = {\n name: 'cloud',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileHorizontalIcon = {\n name: 'file-horizontal',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst subreportIcon = {\n name: 'subreport',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataIcon = {\n name: 'data',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileHeaderIcon = {\n name: 'file-header',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileFooterIcon = {\n name: 'file-footer',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupHeaderSectionIcon = {\n name: 'group-header-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupFooterSectionIcon = {\n name: 'group-footer-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pageHeaderSectionIcon = {\n name: 'page-header-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst pageFooterSectionIcon = {\n name: 'page-footer-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst detailSectionIcon = {\n name: 'detail-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tocSectionIcon = {\n name: 'toc-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupSectionIcon = {\n name: 'group-section',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parametersIcon = {\n name: 'parameters',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataCsvIcon = {\n name: 'data-csv',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataJsonIcon = {\n name: 'data-json',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataSqlIcon = {\n name: 'data-sql',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataWebIcon = {\n name: 'data-web',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst groupCollectionIcon = {\n name: 'group-collection',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parameterBooleanIcon = {\n name: 'parameter-boolean',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parameterDateTimeIcon = {\n name: 'parameter-date-time',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parameterFloatIcon = {\n name: 'parameter-float',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parameterIntegerIcon = {\n name: 'parameter-integer',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parameterStringIcon = {\n name: 'parameter-string',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tocSectionLevelIcon = {\n name: 'toc-section-level',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst inheritedIcon = {\n name: 'inherited',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileVideoIcon = {\n name: 'file-video',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileAudioIcon = {\n name: 'file-audio',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileImageIcon = {\n name: 'file-image',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filePresentationIcon = {\n name: 'file-presentation',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileDataIcon = {\n name: 'file-data',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileDiscImageIcon = {\n name: 'file-disc-image',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileProgrammingIcon = {\n name: 'file-programming',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parametersByteArrayIcon = {\n name: 'parameters-byte-array',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst parametersUnknownIcon = {\n name: 'parameters-unknown',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileErrorIcon = {\n name: 'file-error',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst filesErrorIcon = {\n name: 'files-error',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst dataRestIcon = {\n name: 'data-rest',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst fileTypescriptIcon = {\n name: 'file-typescript',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tablePositionStartIcon = {\n name: 'table-position-start',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tablePositionCenterIcon = {\n name: 'table-position-center',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst tablePositionEndIcon = {\n name: 'table-position-end',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listRomanUpperIcon = {\n name: 'list-roman-upper',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst listRomanLowerIcon = {\n name: 'list-roman-lower',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst importIcon = {\n name: 'import',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst exportIcon = {\n name: 'export',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst graphIcon = {\n name: 'graph',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartColumnClusteredIcon = {\n name: 'chart-column-clustered',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartColumnStackedIcon = {\n name: 'chart-column-stacked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartColumnStacked100Icon = {\n name: 'chart-column-stacked100',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartColumnRangeIcon = {\n name: 'chart-column-range',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartBarClusteredIcon = {\n name: 'chart-bar-clustered',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartBarStackedIcon = {\n name: 'chart-bar-stacked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartBarStacked100Icon = {\n name: 'chart-bar-stacked100',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartBarRangeIcon = {\n name: 'chart-bar-range',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartAreaClusteredIcon = {\n name: 'chart-area-clustered',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartAreaStackedIcon = {\n name: 'chart-area-stacked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartAreaStacked100Icon = {\n name: 'chart-area-stacked100',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartAreaRangeIcon = {\n name: 'chart-area-range',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineIcon = {\n name: 'chart-line',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineStackedIcon = {\n name: 'chart-line-stacked',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineStacked100Icon = {\n name: 'chart-line-stacked100',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineMarkersIcon = {\n name: 'chart-line-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineStackedMarkersIcon = {\n name: 'chart-line-stacked-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartLineStacked100MarkersIcon = {\n name: 'chart-line-stacked100-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartPieIcon = {\n name: 'chart-pie',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartDoughnutIcon = {\n name: 'chart-doughnut',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartScatterIcon = {\n name: 'chart-scatter',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartScatterSmoothLinesMarkersIcon = {\n name: 'chart-scatter-smooth-lines-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartScatterSmoothLinesIcon = {\n name: 'chart-scatter-smooth-lines',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartScatterStraightLinesMarkersIcon = {\n name: 'chart-scatter-straight-lines-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartScatterStraightLinesIcon = {\n name: 'chart-scatter-straight-lines',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartBubbleIcon = {\n name: 'chart-bubble',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartCandlestickIcon = {\n name: 'chart-candlestick',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartOhlcIcon = {\n name: 'chart-ohlc',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartRadarIcon = {\n name: 'chart-radar',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartRadarMarkersIcon = {\n name: 'chart-radar-markers',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartRadarFilledIcon = {\n name: 'chart-radar-filled',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartRoseIcon = {\n name: 'chart-rose',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nconst chartChoroplethIcon = {\n name: 'chart-choropleth',\n content: '',\n viewBox: '0 0 512 512'\n};\n\nexport { accessibilityIcon, aggregateFieldsIcon, alignBottomIcon, alignCenterIcon, alignItemsBaselineAltIcon, alignItemsBaselineIcon, alignItemsCenterAltIcon, alignItemsCenterIcon, alignItemsEndAltIcon, alignItemsEndIcon, alignItemsStartAltIcon, alignItemsStartIcon, alignItemsStretchAltIcon, alignItemsStretchIcon, alignJustifyIcon, alignLeftIcon, alignMiddleIcon, alignRemoveIcon, alignRightIcon, alignSelfCenterAltIcon, alignSelfCenterIcon, alignSelfEndAltIcon, alignSelfEndIcon, alignSelfStartAltIcon, alignSelfStartIcon, alignSelfStretchAltIcon, alignSelfStretchIcon, alignToGridIcon, alignTopIcon, allIcon, anchorIcon, applyFormatIcon, arrowDownIcon, arrowLeftIcon, arrowOverflowDownIcon, arrowRightIcon, arrowRotateCcwIcon, arrowRotateCcwSmallIcon, arrowRotateCwIcon, arrowRotateCwSmallIcon, arrowUpIcon, arrowsAxesIcon, arrowsLeftRightIcon, arrowsMoveIcon, arrowsNoChangeIcon, arrowsNoRepeatIcon, arrowsSwapIcon, arrowsTopBottomIcon, barcodeIcon, barcodeOutlineIcon, barcodeQrCodeScannerIcon, barcodeScannerIcon, behanceBoxIcon, behanceIcon, bellIcon, binocularsIcon, bloggerBoxIcon, bloggerIcon, blurIcon, boldIcon, bookIcon, borderBottomIcon, borderColorIcon, borderLeftIcon, borderRadiusBottomLeftIcon, borderRadiusBottomRightIcon, borderRadiusIcon, borderRadiusTopLeftIcon, borderRadiusTopRightIcon, borderRightIcon, borderStyleBottomIcon, borderStyleIcon, borderStyleLeftIcon, borderStyleRightIcon, borderStyleTopIcon, borderTopIcon, borderTypeIcon, bordersAllIcon, bordersInsideHorizontalIcon, bordersInsideIcon, bordersInsideVerticalIcon, bordersNoneIcon, bordersOutsideIcon, bordersShowHideIcon, boxSizingIcon, brightnessContrastIcon, bringBackwardIcon, bringForwardIcon, bringToBackIcon, bringToFrontIcon, brushIcon, buildingBlocksIcon, buttonIcon, calculatorIcon, calendarDateIcon, calendarIcon, cameraIcon, cancelCircleIcon, cancelIcon, cancelOutlineIcon, caretAltDownIcon, caretAltExpandIcon, caretAltLeftIcon, caretAltRightIcon, caretAltToBottomIcon, caretAltToLeftIcon, caretAltToRightIcon, caretAltToTopIcon, caretAltUpIcon, caretBlIcon, caretBrIcon, caretDoubleAltDownIcon, caretDoubleAltLeftIcon, caretDoubleAltRightIcon, caretDoubleAltUpIcon, caretTlIcon, caretTrIcon, cartIcon, categorizeIcon, cellSplitHorizontallyIcon, cellSplitVerticallyIcon, cellsMergeHorizontallyIcon, cellsMergeIcon, cellsMergeVerticallyIcon, changeManuallyIcon, chartAreaClusteredIcon, chartAreaRangeIcon, chartAreaStacked100Icon, chartAreaStackedIcon, chartBarClusteredIcon, chartBarRangeIcon, chartBarStacked100Icon, chartBarStackedIcon, chartBubbleIcon, chartCandlestickIcon, chartChoroplethIcon, chartColumnClusteredIcon, chartColumnRangeIcon, chartColumnStacked100Icon, chartColumnStackedIcon, chartDoughnutIcon, chartLineIcon, chartLineMarkersIcon, chartLineStacked100Icon, chartLineStacked100MarkersIcon, chartLineStackedIcon, chartLineStackedMarkersIcon, chartOhlcIcon, chartPieIcon, chartRadarFilledIcon, chartRadarIcon, chartRadarMarkersIcon, chartRoseIcon, chartScatterIcon, chartScatterSmoothLinesIcon, chartScatterSmoothLinesMarkersIcon, chartScatterStraightLinesIcon, chartScatterStraightLinesMarkersIcon, checkCircleIcon, checkIcon, checkOutlineIcon, checkboxCheckedIcon, checkboxIcon, checkboxIndeterminateIcon, checkboxNullIcon, chevronDoubleDownIcon, chevronDoubleLeftIcon, chevronDoubleRightIcon, chevronDoubleUpIcon, chevronDownIcon, chevronLeftIcon, chevronRightIcon, chevronUpIcon, circleIcon, clearCssIcon, clipboardCodeIcon, clipboardHtmlIcon, clipboardIcon, clipboardMarkdownIcon, clipboardTextIcon, clipboardWordAltIcon, clipboardWordIcon, clockArrowRotateIcon, clockIcon, closedCaptionsIcon, cloudIcon, codeIcon, codeSnippetIcon, colResizeIcon, columnFreezeIcon, columnsIcon, commentIcon, commentRemoveIcon, commentsRemoveIcon, connectorIcon, convertLowercaseIcon, convertUppercaseIcon, copyFormatIcon, copyIcon, cropIcon, crosstabIcon, crosstabWizardIcon, csIcon, csprojIcon, css3Icon, cssIcon, customFormatIcon, customIconIcon, cutIcon, dataCsvIcon, dataIcon, dataJsonIcon, dataOdsIcon, dataRestIcon, dataSdsIcon, dataSqlIcon, dataWebIcon, decimalDecreaseIcon, decimalIncreaseIcon, decreaseHorizontalSpacingIcon, decreaseVerticalSpacingIcon, deliciousBoxIcon, deliciousIcon, detailSectionIcon, diggBoxIcon, diggIcon, dimensionsIcon, displayBlockIcon, displayFlexIcon, displayInlineBlockIcon, displayInlineFlexIcon, divIcon, divideIcon, documentManagerIcon, dollarIcon, downloadIcon, downloadLightIcon, dragAndDropIcon, dribbbleBoxIcon, dribbbleIcon, dropletIcon, dropletSlashIcon, dropletSliderIcon, editAnnotationsIcon, editToolsIcon, envelopBoxIcon, envelopIcon, envelopLinkIcon, envelopeBoxIcon, envelopeIcon, envelopeLinkIcon, equalIcon, eraserOutlineIcon, exclamationCircleIcon, exeIcon, exportIcon, eyeIcon, eyeSlashIcon, eyedropperIcon, facebookBoxIcon, facebookIcon, fileAddIcon, fileAscxIcon, fileAudioIcon, fileBacIcon, fileConfigIcon, fileCsvIcon, fileDataIcon, fileDiscImageIcon, fileErrorIcon, fileExcelIcon, fileFlashIcon, fileFooterIcon, fileHeaderIcon, fileHorizontalIcon, fileIcon, fileImageIcon, fileMdbIcon, filePdfIcon, filePptIcon, filePresentationIcon, fileProgrammingIcon, filePsdIcon, fileReportIcon, fileTxtIcon, fileTypescriptIcon, fileVideoIcon, fileWordIcon, fileWrenchIcon, fileZipIcon, filesErrorIcon, filmIcon, filterAddExpressionIcon, filterAddGroupIcon, filterClearIcon, filterIcon, filterSmallIcon, filterSortAscSmallIcon, filterSortDescSmallIcon, flashManagerIcon, flipHorizontalIcon, flipVerticalIcon, folderAddIcon, folderIcon, folderMoreIcon, folderOpenIcon, folderUpIcon, fontFamilyIcon, fontGrowIcon, fontShrinkIcon, fontSizeIcon, foregroundColorIcon, formElementIcon, formIcon, formatCodeBlockIcon, formulaFxIcon, forwardIcon, freeTextIcon, fullscreenExitIcon, fullscreenIcon, gapColumnIcon, gapRowIcon, gaugeLinearIcon, gaugeRadialIcon, gearIcon, gearsIcon, globeIcon, globeLinkIcon, globeOutlineIcon, globeUnlinkIcon, googleBoxIcon, googleIcon, googlePlusBoxIcon, googlePlusIcon, graphIcon, grayscaleIcon, greaterOrEqualIcon, gridIcon, gridLayoutIcon, groupBoxIcon, groupCollectionIcon, groupFooterSectionIcon, groupHeaderSectionIcon, groupIcon, groupSectionIcon, h1Icon, h2Icon, h3Icon, h4Icon, h5Icon, h6Icon, handIcon, handleDragIcon, handleResizeAltIcon, handleResizeIcon, hdIcon, heartIcon, heartOutlineIcon, highlightFreeIcon, highlightIcon, homeIcon, horizontalRuleIcon, html5Icon, hyperlinkOpenIcon, hyperlinkOpenSmIcon, imageAbsolutePositionIcon, imageAddIcon, imageEditIcon, imageExportIcon, imageIcon, imageMapEditorIcon, imageResizeIcon, imagesIcon, importIcon, inboxIcon, increaseHorizontalSpacingIcon, increaseVerticalSpacingIcon, indentIcon, infoCircleIcon, infoSolidIcon, inheritedIcon, insertBottomIcon, insertMiddleIcon, insertTopIcon, invertColorsIcon, italicIcon, jsIcon, justifyContentAroundAltIcon, justifyContentAroundIcon, justifyContentBetweenAltIcon, justifyContentBetweenIcon, justifyContentCenterAltIcon, justifyContentCenterIcon, justifyContentEndAltIcon, justifyContentEndIcon, justifyContentStartAltIcon, justifyContentStartIcon, kpiStatusDenyIcon, kpiStatusHoldIcon, kpiStatusOpenIcon, launchIcon, layout1By4Icon, layout2By2Icon, layoutIcon, layoutSideBySideIcon, layoutStackedIcon, lessOrEqualIcon, letterSpaceIcon, levelDownIcon, levelToTopIcon, levelUpIcon, lineHeightIcon, linkAddIcon, linkIcon, linkVerticalIcon, linkedinBoxIcon, linkedinIcon, listLatinBigIcon, listLatinSmallIcon, listOrderedIcon, listRomanBigIcon, listRomanLowerIcon, listRomanSmallIcon, listRomanUpperIcon, listUnorderedIcon, listUnorderedOutlineIcon, listUnorderedSquareIcon, lockIcon, loginIcon, logoutIcon, makeHorizontalSpacingEqualIcon, makeSameHeightIcon, makeSameSizeIcon, makeSameWidthIcon, makeVerticalSpacingEqualIcon, mapMarkerIcon, mapMarkerTargetIcon, maxHeightIcon, maxWidthIcon, mediaManagerIcon, menuIcon, minHeightIcon, minWidthIcon, minusCircleIcon, minusIcon, minusOutlineIcon, minusSmIcon, mirrorIcon, moreHorizontalIcon, moreVerticalIcon, musicNotesIcon, myspaceBoxIcon, myspaceIcon, nonRecurrenceIcon, notEqualIcon, outdentIcon, outlineOffsetIcon, outlineWidthIcon, overlapIcon, paddingBottomIcon, paddingIcon, paddingLeftIcon, paddingRightIcon, paddingTopIcon, pageFooterSectionIcon, pageHeaderSectionIcon, paletteIcon, paneFreezeIcon, paperPlaneIcon, paperclipAltIcon, paperclipIcon, paragraphAddIcon, paragraphHeightIcon, paragraphMarkIcon, parameterBooleanIcon, parameterDateTimeIcon, parameterFloatIcon, parameterIntegerIcon, parameterStringIcon, parametersByteArrayIcon, parametersIcon, parametersUnknownIcon, passwordIcon, pauseIcon, pauseSmIcon, pencilIcon, percentIcon, photosIcon, pinIcon, pinterestBoxIcon, pinterestIcon, playIcon, playSmIcon, playlistIcon, plusCircleIcon, plusIcon, plusOutlineIcon, plusSmIcon, pointerIcon, positionBottomIcon, positionLeftIcon, positionRightIcon, positionTopIcon, printIcon, puzzlePieceIcon, qrCodeIcon, qrCodeOutlineIcon, qrCodeScannerIcon, questionCircleIcon, radiobuttonCheckedIcon, radiobuttonIcon, redditBoxIcon, redditIcon, redoIcon, regularExpressionIcon, removeHorizontalSpacingIcon, removeVerticalSpacingIcon, reorderIcon, replaceAllIcon, replaceSingleIcon, reportElementIcon, rewindIcon, rightDoubleQuotesIcon, rotateIcon, rotateLeftIcon, rotateRightIcon, roundCornersIcon, rowFreezeIcon, rowsIcon, rssBoxIcon, rssIcon, rulerOutlineIcon, saveIcon, searchIcon, selectAllIcon, selectBoxIcon, setColumnPositionIcon, shapeLineIcon, shapesIcon, shareIcon, sharpenIcon, signatureIcon, silverlightIcon, sizeToGridIcon, slidersIcon, slnIcon, snapGridIcon, snapToGridlinesIcon, snapToSnaplinesIcon, sortAscIcon, sortAscSmallIcon, sortClearIcon, sortDescIcon, sortDescSmallIcon, sparklesIcon, spellCheckerIcon, stampIcon, starIcon, starOutlineIcon, stickIcon, stickyNoteIcon, stopIcon, stopSmIcon, strikethroughIcon, stripAllFormattingIcon, stripCssFormatIcon, stripFontElementsIcon, stripSpanElementsIcon, stripWordFormattingIcon, stumbleUponBoxIcon, stumbleUponIcon, subreportIcon, subscriptIcon, sumIcon, supscriptIcon, symbolIcon, tableAddIcon, tableAlignBottomCenterIcon, tableAlignBottomLeftIcon, tableAlignBottomRightIcon, tableAlignMiddleCenterIcon, tableAlignMiddleLeftIcon, tableAlignMiddleRightIcon, tableAlignRemoveIcon, tableAlignTopCenterIcon, tableAlignTopLeftIcon, tableAlignTopRightIcon, tableBodyIcon, tableCellDeleteIcon, tableCellIcon, tableCellPropertiesIcon, tableColumnDeleteIcon, tableColumnGroupsIcon, tableColumnInsertLeftIcon, tableColumnInsertRightIcon, tableCornerIcon, tableDeleteIcon, tableIcon, tablePositionCenterIcon, tablePositionEndIcon, tablePositionStartIcon, tablePropertiesIcon, tableRowDeleteIcon, tableRowGroupsIcon, tableRowInsertAboveIcon, tableRowInsertBelowIcon, tableUnmergeIcon, tableWizardIcon, tellAFriendBoxIcon, tellAFriendIcon, templateManagerIcon, textClipIcon, textOverflowIcon, textTruncateIcon, textWrapArrowIcon, textWrapIcon, textareaIcon, textboxHiddenIcon, textboxIcon, thumbDownIcon, thumbDownOutlineIcon, thumbUpIcon, thumbUpOutlineIcon, thumbnailsDownIcon, thumbnailsLeftIcon, thumbnailsRightIcon, thumbnailsUpIcon, tocSectionIcon, tocSectionLevelIcon, toggleFullScreenModeIcon, toolbarFloatIcon, trackChangesAcceptAllIcon, trackChangesAcceptIcon, trackChangesEnableIcon, trackChangesIcon, trackChangesRejectAllIcon, trackChangesRejectIcon, transparencyIcon, trashIcon, tumblrBoxIcon, tumblrIcon, twitterBoxIcon, twitterIcon, underlineIcon, undoIcon, ungroupIcon, unlinkIcon, unlinkVerticalIcon, unlockIcon, unpinIcon, unstickIcon, uploadIcon, userIcon, userOutlineIcon, validationDataIcon, validationXhtmlIcon, vbIcon, vbprojIcon, videoExternalIcon, vimeoBoxIcon, vimeoIcon, volumeDownIcon, volumeMuteIcon, volumeUpIcon, walletSolidIcon, warningCircleIcon, warningTriangleIcon, wholeWordIcon, windowIcon, windowMinimizeIcon, windowRestoreIcon, wrenchIcon, xCircleIcon, xIcon, xLogoIcon, xOutlineIcon, yammerBoxIcon, yammerIcon, youtubeBoxIcon, youtubeIcon, zoomActualSizeIcon, zoomBestFitIcon, zoomInIcon, zoomOutIcon };\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * @hidden\n */\nexport var SELECTION_TYPE;\n(function (SELECTION_TYPE) {\n SELECTION_TYPE[\"single\"] = \"single\";\n SELECTION_TYPE[\"multiple\"] = \"multiple\";\n SELECTION_TYPE[\"none\"] = \"none\";\n})(SELECTION_TYPE || (SELECTION_TYPE = {}));\n/**\n * @hidden\n */\nexport var SELECTION_ACTION;\n(function (SELECTION_ACTION) {\n SELECTION_ACTION[\"toggle\"] = \"toggle\";\n SELECTION_ACTION[\"remove\"] = \"remove\";\n})(SELECTION_ACTION || (SELECTION_ACTION = {}));\n/**\n * @hidden\n */\nexport var selectionReducer = function (state, action) {\n switch (action.selection) {\n case SELECTION_TYPE.single:\n switch (action.type) {\n case SELECTION_ACTION.toggle: {\n if (!Array.isArray(state) || state === null) {\n return action.payload === state ? null : action.payload;\n }\n throw new Error('State cannot be an array in single selection');\n }\n case SELECTION_ACTION.remove: {\n return action.payload === state ? null : state;\n }\n default:\n return state;\n }\n case SELECTION_TYPE.multiple:\n switch (action.type) {\n case SELECTION_ACTION.toggle: {\n if (Array.isArray(state)) {\n return state.some(function (i) { return i === action.payload; })\n ? state.filter(function (i) { return i !== action.payload; })\n : __spreadArray(__spreadArray([], state, true), [action.payload], false);\n }\n if (state === null) {\n return [action.payload];\n }\n throw new Error('State cannot be non-array in multiple selection');\n }\n case SELECTION_ACTION.remove: {\n if (Array.isArray(state)) {\n return state.some(function (i) { return i === action.payload; })\n ? state.filter(function (i) { return i !== action.payload; })\n : __spreadArray(__spreadArray([], state, true), [action.payload], false);\n }\n return state;\n }\n default:\n return state;\n }\n case SELECTION_TYPE.none:\n return null;\n default:\n return state;\n }\n};\n","/**\n * @hidden\n */\nexport var FOCUS_ACTION;\n(function (FOCUS_ACTION) {\n FOCUS_ACTION[\"next\"] = \"next\";\n FOCUS_ACTION[\"prev\"] = \"prev\";\n FOCUS_ACTION[\"current\"] = \"current\";\n FOCUS_ACTION[\"reset\"] = \"reset\";\n})(FOCUS_ACTION || (FOCUS_ACTION = {}));\n/**\n * @hidden\n */\nexport var focusReducer = function (state, action) {\n var currentIndex = action.items.findIndex(function (i) { return i === state; });\n switch (action.type) {\n case FOCUS_ACTION.next:\n return currentIndex === action.items.length - 1\n ? state\n : action.items[currentIndex + 1];\n case FOCUS_ACTION.prev:\n return currentIndex === 0\n ? state\n : action.items[currentIndex - 1];\n case FOCUS_ACTION.current:\n return action.payload;\n case FOCUS_ACTION.reset:\n return null;\n default:\n return state;\n }\n};\n","/**\n * @hidden\n */\nexport var CHIP_DATA_ACTION;\n(function (CHIP_DATA_ACTION) {\n CHIP_DATA_ACTION[\"remove\"] = \"remove\";\n CHIP_DATA_ACTION[\"add\"] = \"add\";\n CHIP_DATA_ACTION[\"reorder\"] = \"reorder\";\n})(CHIP_DATA_ACTION || (CHIP_DATA_ACTION = {}));\n/**\n * @hidden\n */\nexport var dataReducer = function (state, action) {\n switch (action.type) {\n case CHIP_DATA_ACTION.add:\n // TODO v2\n break;\n case CHIP_DATA_ACTION.remove:\n return state.filter(function (i) { return i[action.valueField] !== action.payload; });\n case CHIP_DATA_ACTION.reorder:\n // TODO v2\n break;\n default:\n return state;\n }\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { useDir, getter, getTabIndex, classNames, useMouse, kendoThemeMaps } from '@progress/kendo-react-common';\nimport { selectionReducer } from './selection-reducer';\nimport { focusReducer } from './focus-reducer';\nimport { dataReducer } from './data-reducer';\nimport { Chip } from './Chip';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\n/**\n * @hidden\n */\nexport var ChipListSelectionContext = React.createContext([null, function (_args) {\n /**/\n }]);\n/**\n * @hidden\n */\nexport var ChipListFocusContext = React.createContext([null, function (_args) {\n /**/\n }]);\n/**\n * @hidden\n */\nexport var ChipListDataContext = React.createContext([null, function (_args) {\n /**/\n }]);\n/**\n * @hidden\n */\nvar useSelection = function (defaultValue, args, callback) {\n var _a = React.useState(defaultValue), state = _a[0], setState = _a[1];\n var handleDispatchSelection = function (action) {\n var newState = selectionReducer(args.state || state, __assign(__assign({}, action), args));\n if (callback) {\n callback(newState, action.event);\n }\n setState(newState);\n };\n return [state, handleDispatchSelection];\n};\n/**\n * @hidden\n */\nvar useFocus = function (args) {\n var _a = React.useState(null), state = _a[0], setState = _a[1];\n var handleDispatchFocus = function (action) {\n var newState = focusReducer(action.payload, __assign(__assign({}, action), args));\n setState(newState);\n };\n return [state, handleDispatchFocus];\n};\n/**\n * @hidden\n */\nvar useData = function (defaultData, args, callback) {\n var _a = React.useState(defaultData), state = _a[0], setState = _a[1];\n var handleDispatchData = function (action) {\n var newState = dataReducer(args.state || state, __assign(__assign({}, action), args));\n if (callback) {\n callback(newState, action.event);\n }\n setState(newState);\n };\n return [state, handleDispatchData];\n};\n/**\n * Represents the ChipList component.\n */\nexport var ChipList = React.forwardRef(function (props, ref) {\n var _a;\n validatePackage(packageMetadata);\n var target = React.useRef(null);\n var chipListRef = React.useRef(null);\n var dir = useDir(chipListRef, props.dir);\n var chip = props.chip, id = props.id, style = props.style, tabIndex = props.tabIndex, disabled = props.disabled, size = props.size, className = props.className, ariaDescribedBy = props.ariaDescribedBy, ariaLabelledBy = props.ariaLabelledBy, _b = props.selection, selection = _b === void 0 ? defaultProps.selection : _b, _c = props.value, value = _c === void 0 ? defaultProps.defaultValue : _c, _d = props.defaultData, defaultData = _d === void 0 ? defaultProps.defaultData : _d, _e = props.valueField, valueField = _e === void 0 ? defaultProps.valueField : _e, _f = props.textField, textField = _f === void 0 ? defaultProps.textField : _f, onChange = props.onChange, onDataChange = props.onDataChange;\n var ChipComponent = React.useMemo(function () { return chip || Chip; }, [chip, Chip]);\n React.useImperativeHandle(target, function () { return ({\n element: chipListRef.current,\n props: props\n }); });\n React.useImperativeHandle(ref, function () { return target.current; });\n var handleChange = React.useCallback(function (newValue, event) {\n if (onChange && target.current) {\n onChange.call(undefined, {\n value: newValue,\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [onChange]);\n var _g = useSelection(value, {\n selection: selection,\n state: value\n }, handleChange), stateValue = _g[0], dispatchStateValue = _g[1];\n var handleDataChange = React.useCallback(function (newData, event) {\n if (onDataChange && target.current) {\n onDataChange.call(undefined, {\n value: newData,\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [onDataChange]);\n var _h = useData(props.data || defaultData, {\n state: props.data,\n valueField: valueField\n }, handleDataChange), stateData = _h[0], dispatchData = _h[1];\n var itemsReducer = React.useCallback(function (acc, current) {\n acc.push(current[valueField]);\n return acc;\n }, [valueField]);\n var data = React.useMemo(function () { return props.data || stateData; }, [props.data, stateData]);\n var chipValue = React.useMemo(function () { return value || stateValue; }, [value, stateValue]);\n var items = React.useMemo(function () { return data.reduce(itemsReducer, []); }, [data, itemsReducer]);\n var valueGetter = React.useCallback(function (item) { return getter(valueField)(item); }, [valueField]);\n var textGetter = React.useCallback(function (item) { return getter(textField)(item); }, [textField]);\n var _j = useFocus({ items: items }), focus = _j[0], dispatchFocus = _j[1];\n var mouseProps = useMouse(props, target);\n return (React.createElement(ChipListSelectionContext.Provider, { value: [chipValue, dispatchStateValue] },\n React.createElement(ChipListFocusContext.Provider, { value: [focus, dispatchFocus] },\n React.createElement(ChipListDataContext.Provider, { value: [data, dispatchData] },\n React.createElement(\"div\", __assign({ ref: chipListRef }, mouseProps, { role: 'listbox', id: id, dir: dir, style: style, tabIndex: getTabIndex(tabIndex, disabled, undefined), className: classNames('k-chip-list', (_a = {\n 'k-rtl': dir === 'rtl',\n 'k-disabled': disabled\n },\n _a[\"k-chip-list-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _a), className), \"aria-labelledby\": ariaLabelledBy, \"aria-describedby\": ariaDescribedBy }), data.map(function (item, index) {\n return (React.createElement(ChipComponent, { role: 'option', dataItem: item, size: size, key: [valueGetter(item), index].join('-'), text: textGetter(item), value: valueGetter(item), ariaLabel: item.ariaLabel }));\n }))))));\n});\nvar propTypes = {\n id: PropTypes.string,\n className: PropTypes.string,\n tabIndex: PropTypes.number,\n data: PropTypes.any,\n defaultData: PropTypes.arrayOf(PropTypes.any),\n onDataChange: PropTypes.func,\n value: PropTypes.oneOfType([PropTypes.any, PropTypes.arrayOf(PropTypes.any)]),\n defaultValue: PropTypes.oneOfType([PropTypes.any, PropTypes.arrayOf(PropTypes.any)]),\n onChange: PropTypes.func,\n selection: PropTypes.oneOf(['single', 'none', 'multiple']),\n textField: PropTypes.string,\n valueField: PropTypes.string,\n disabled: PropTypes.bool,\n dir: PropTypes.oneOf(['ltr', 'rtl']),\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large'])\n};\nvar defaultProps = {\n chip: Chip,\n size: 'medium',\n disabled: false,\n defaultValue: null,\n defaultData: [],\n dir: 'ltr',\n selection: 'none',\n textField: 'text',\n valueField: 'value',\n removable: 'removable'\n};\nChipList.displayName = 'KendoReactChipList';\n// TODO: delete casting when @types/react is updated!\nChipList.propTypes = propTypes;\nChipList.defaultProps = defaultProps;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { ChipListSelectionContext, ChipListFocusContext, ChipListDataContext } from './ChipList';\nimport { classNames, useDir, getTabIndex, Keys, IconWrap, kendoThemeMaps, toIconName, svgIconPropType } from '@progress/kendo-react-common';\nimport { FOCUS_ACTION } from './focus-reducer';\nimport { CHIP_DATA_ACTION } from './data-reducer';\nimport { SELECTION_ACTION } from './selection-reducer';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport { useMouse } from '@progress/kendo-react-common';\n/**\n * Represents the Chip component.\n */\nexport var Chip = React.forwardRef(function (props, ref) {\n var _a;\n validatePackage(packageMetadata);\n var target = React.useRef(null);\n var chipRef = React.useRef(null);\n var dir = useDir(chipRef, props.dir);\n React.useImperativeHandle(target, function () { return ({\n element: chipRef.current,\n props: props\n }); });\n React.useImperativeHandle(ref, function () { return target.current; });\n var _b = React.useContext(ChipListSelectionContext), selection = _b[0], dispatchSelection = _b[1];\n var _c = React.useContext(ChipListFocusContext), focus = _c[0], dispatchFocus = _c[1];\n var _d = React.useContext(ChipListDataContext), dispatchData = _d[1];\n var selected = React.useMemo(function () {\n return (props.selected || (Array.isArray(selection)\n ? selection.some(function (i) { return i === props.value; })\n : selection === props.value));\n }, [props.selected, props.value, selection]);\n var focused = React.useMemo(function () { return focus === props.value; }, [props.value, focus]);\n React.useEffect(function () {\n if (focused && chipRef.current) {\n chipRef.current.focus();\n }\n }, [focused]);\n var handleClick = React.useCallback(function (event) {\n dispatchSelection({ type: SELECTION_ACTION.toggle, payload: props.value, event: event });\n }, [dispatchSelection, props.value]);\n var handleRemove = React.useCallback(function (event) {\n if (!props.removable) {\n return;\n }\n dispatchData({ type: CHIP_DATA_ACTION.remove, payload: props.value, event: event });\n dispatchFocus({ type: FOCUS_ACTION.reset, payload: props.value, event: event });\n dispatchSelection({ type: SELECTION_ACTION.remove, payload: props.value, event: event });\n if (props.onRemove) {\n props.onRemove.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [props.onRemove, props.value, props.removable, dispatchData, dispatchFocus, dispatchSelection]);\n var handleKeyDown = React.useCallback(function (event) {\n switch (event.keyCode) {\n case Keys.left:\n dispatchFocus({ type: FOCUS_ACTION.prev, payload: props.value, event: event });\n break;\n case Keys.right:\n dispatchFocus({ type: FOCUS_ACTION.next, payload: props.value, event: event });\n break;\n case Keys.enter:\n dispatchSelection({ type: SELECTION_ACTION.toggle, payload: props.value, event: event });\n break;\n case Keys.delete:\n handleRemove(event);\n break;\n default:\n break;\n }\n if (props.onKeyDown) {\n props.onKeyDown.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [props.onKeyDown, props.value, dispatchFocus, dispatchSelection, handleRemove]);\n var handleFocus = React.useCallback(function (event) {\n dispatchFocus({ payload: props.value, type: FOCUS_ACTION.current, event: event });\n if (props.onFocus) {\n props.onFocus.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [props.onFocus, props.value, dispatchFocus]);\n var handleBlur = React.useCallback(function (event) {\n if (props.onBlur) {\n props.onBlur.call(undefined, {\n target: target.current,\n syntheticEvent: event\n });\n }\n }, [props.onBlur]);\n var mouseProps = useMouse(props, target, { onClick: handleClick });\n return (React.createElement(\"div\", __assign({}, mouseProps, { role: props.role, id: props.value, style: props.style, ref: chipRef, dir: dir, tabIndex: getTabIndex(props.tabIndex, props.disabled, undefined), className: classNames('k-chip', (_a = {\n 'k-rtl': dir === 'rtl',\n 'k-disabled': props.disabled,\n 'k-selected': selected,\n 'k-focus': focused\n },\n _a[\"k-chip-\".concat(kendoThemeMaps.sizeMap[props.size] || props.size)] = props.size,\n _a[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[props.rounded] || props.rounded)] = props.rounded,\n _a[\"k-chip-\".concat(props.fillMode)] = props.fillMode,\n _a[\"k-chip-\".concat(props.fillMode, \"-\").concat(props.themeColor)] = Boolean(props.fillMode && props.themeColor),\n _a), props.className), \"aria-checked\": selected, \"aria-disabled\": props.disabled, \"aria-describedby\": props.ariaDescribedBy, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown }),\n (selected && (props.selectedIcon || props.selectedSvgIcon)) &&\n React.createElement(IconWrap, { className: 'k-chip-icon', name: props.selectedIcon ? toIconName(props.selectedIcon) : undefined, icon: props.selectedSvgIcon, size: 'small' }),\n (props.icon || props.svgIcon) &&\n React.createElement(IconWrap, { className: 'k-chip-icon', name: props.icon ? toIconName(props.icon) : undefined, icon: props.svgIcon, size: 'small' }),\n (props.avatar) &&\n React.createElement(\"div\", { className: \"k-chip-avatar k-avatar k-rounded-\".concat(props.avatar.rounded, \" k-avatar-md k-avatar-solid k-avatar-solid-primary\"), style: props.avatar.style },\n React.createElement(\"span\", { className: \"k-avatar-image\" },\n React.createElement(\"img\", { src: props.avatar.image, alt: props.avatar.imageAlt }))),\n React.createElement(\"span\", { className: 'k-chip-content' }, props.children !== undefined\n ? props.children\n : props.text &&\n React.createElement(\"span\", { \"aria-label\": props.ariaLabel || props.text, className: 'k-chip-label' }, props.text)),\n props.removable && (React.createElement(\"span\", { className: \"k-chip-actions\" },\n React.createElement(\"span\", { className: classNames('k-chip-action', 'k-chip-remove-action'), onClick: handleRemove },\n React.createElement(IconWrap, { name: props.removeIcon ? toIconName(props.removeIcon) : undefined, icon: props.removeSvgIcon, size: 'small' }))))));\n});\nvar propTypes = {\n id: PropTypes.string,\n text: PropTypes.string,\n value: PropTypes.any,\n dir: PropTypes.oneOf(['ltr', 'rtl']),\n removable: PropTypes.bool,\n removeIcon: PropTypes.string,\n removeIconSvg: svgIconPropType,\n disabled: PropTypes.bool,\n icon: PropTypes.string,\n svgIcon: svgIconPropType,\n selectedIcon: PropTypes.string,\n selectedIconSvg: svgIconPropType,\n onRemove: PropTypes.func,\n dataItem: PropTypes.any,\n selected: PropTypes.bool,\n ariaDescribedBy: PropTypes.string,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'outline', 'solid']),\n // eslint-disable-next-line max-len\n themeColor: PropTypes.oneOf([null, 'base', 'info', 'success', 'warning', 'error'])\n};\nvar defaultProps = {\n disabled: false,\n removable: false,\n removeIcon: 'k-i-x-circle',\n dir: 'ltr',\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid',\n themeColor: 'base'\n};\nChip.displayName = 'KendoReactChip';\n// TODO: delete casting when @types/react is updated!\nChip.propTypes = propTypes;\nChip.defaultProps = defaultProps;\n","var _a;\n/**\n * @hidden\n */\nexport var pagerInfo = 'pager.info';\n/**\n * @hidden\n */\nexport var pagerFirstPage = 'pager.firstPage';\n/**\n * @hidden\n */\nexport var pagerPreviousPage = 'pager.previousPage';\n/**\n * @hidden\n */\nexport var pagerNextPage = 'pager.nextPage';\n/**\n * @hidden\n */\nexport var pagerLastPage = 'pager.lastPage';\n/**\n * @hidden\n */\nexport var pagerItemPerPage = 'pager.itemsPerPage';\n/**\n * @hidden\n */\nexport var pagerPageSelection = 'pager.pageSelection';\n/**\n * @hidden\n */\nexport var pagerPage = 'pager.page';\n/**\n * @hidden\n */\nexport var pagerOf = 'pager.of';\n/**\n * @hidden\n */\nexport var pagerTotalPages = 'pager.totalPages';\n/**\n * @hidden\n */\nexport var pagerPageNumberLabel = 'pager.pageLabel';\n/**\n * @hidden\n */\nexport var pagerAriaKeyshortcuts = 'pager.ariaKeyshortcuts';\n/**\n * @hidden\n */\nexport var pagerAriaLabel = 'pager.ariaLabel';\n/**\n * @hidden\n */\nexport var pagerPageSizeAriaLabel = 'pager.pageSizeAriaLabel';\n/**\n * @hidden\n */\nexport var pagerMobileSelect = 'pager.mobileSelect';\n/**\n * @hidden\n */\nexport var pagerMoreButtonLabel = 'pager.moreButtonLabel';\n/**\n * @hidden\n */\nexport var filterEqOperator = 'filter.eqOperator';\n/**\n * @hidden\n */\nexport var filterNotEqOperator = 'filter.notEqOperator';\n/**\n * @hidden\n */\nexport var filterIsNullOperator = 'filter.isNullOperator';\n/**\n * @hidden\n */\nexport var filterIsNotNullOperator = 'filter.isNotNullOperator';\n/**\n * @hidden\n */\nexport var filterIsEmptyOperator = 'filter.isEmptyOperator';\n/**\n * @hidden\n */\nexport var filterIsNotEmptyOperator = 'filter.isNotEmptyOperator';\n/**\n * @hidden\n */\nexport var filterStartsWithOperator = 'filter.startsWithOperator';\n/**\n * @hidden\n */\nexport var filterContainsOperator = 'filter.containsOperator';\n/**\n * @hidden\n */\nexport var filterNotContainsOperator = 'filter.notContainsOperator';\n/**\n * @hidden\n */\nexport var filterEndsWithOperator = 'filter.endsWithOperator';\n/**\n * @hidden\n */\nexport var filterGteOperator = 'filter.gteOperator';\n/**\n * @hidden\n */\nexport var filterGtOperator = 'filter.gtOperator';\n/**\n * @hidden\n */\nexport var filterLteOperator = 'filter.lteOperator';\n/**\n * @hidden\n */\nexport var filterLtOperator = 'filter.ltOperator';\n/**\n * @hidden\n */\nexport var filterIsTrue = 'filter.isTrue';\n/**\n * @hidden\n */\nexport var filterIsFalse = 'filter.isFalse';\n/**\n * @hidden\n */\nexport var filterAfterOrEqualOperator = 'filter.afterOrEqualOperator';\n/**\n * @hidden\n */\nexport var filterAfterOperator = 'filter.afterOperator';\n/**\n * @hidden\n */\nexport var filterBeforeOperator = 'filter.beforeOperator';\n/**\n * @hidden\n */\nexport var filterBeforeOrEqualOperator = 'filter.beforeOrEqualOperator';\n/**\n * @hidden\n */\nexport var filterAndLogic = 'filter.andLogic';\n/**\n * @hidden\n */\nexport var filterOrLogic = 'filter.orLogic';\n/**\n * @hidden\n */\nexport var filterAddExpression = 'filter.addExpression';\n/**\n * @hidden\n */\nexport var filterAddGroup = 'filter.addGroup';\n/**\n * @hidden\n */\nexport var filterClose = 'filter.close';\n/**\n * @hidden\n */\nexport var filterGroupAriaLabel = 'filter.groupAriaLabel';\n/**\n * @hidden\n */\nexport var filterExpressionAriaLabel = 'filter.expressionAriaLabel';\n/**\n * @hidden\n */\nexport var filterExpressionDropdownAriaLabel = 'filter.expressionDropdownAriaLabel';\n/**\n * @hidden\n */\nexport var filterExpressionOperatorDropdownAriaLabel = 'filter.expressionOperatorDropdownAriaLabel';\n/**\n * @hidden\n */\nexport var filterEnumFilterDropdownAriaLabel = 'filter.enumFilterDropdownAriaLabel';\n/**\n * @hidden\n */\nexport var filterNumericFilterAriaLabel = 'filter.numericFilterAriaLabel';\n/**\n * @hidden\n */\nexport var filterTextFilterAriaLabel = 'filter.textFilterAriaLabel';\n/**\n * @hidden\n */\nexport var columnMenuFilterClearButton = 'columnMenu.filterClearButton';\n/**\n * @hidden\n */\nexport var columnMenuFilterSubmitButton = 'columnMenu.filterSubmitButton';\n/**\n * @hidden\n */\nexport var columnMenuFilterTitle = 'columnMenu.filterTitle';\n/**\n * @hidden\n */\nexport var columnMenuSortAscending = 'columnMenu.sortAscending';\n/**\n * @hidden\n */\nexport var columnMenuSortDescending = 'columnMenu.sortDescending';\n/**\n * @hidden\n */\nexport var columnMenuFilterEqOperator = 'columnMenu.filterEqOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterNotEqOperator = 'columnMenu.filterNotEqOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterIsNullOperator = 'columnMenu.filterIsNullOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterIsNotNullOperator = 'columnMenu.filterIsNotNullOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterIsEmptyOperator = 'columnMenu.filterIsEmptyOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterIsNotEmptyOperator = 'columnMenu.filterIsNotEmptyOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterStartsWithOperator = 'columnMenu.filterStartsWithOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterContainsOperator = 'columnMenu.filterContainsOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterNotContainsOperator = 'columnMenu.filterNotContainsOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterEndsWithOperator = 'columnMenu.filterEndsWithOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterGteOperator = 'columnMenu.filterGteOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterGtOperator = 'columnMenu.filterGtOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterLteOperator = 'columnMenu.filterLteOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterLtOperator = 'columnMenu.filterLtOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterIsTrue = 'columnMenu.filterIsTrue';\n/**\n * @hidden\n */\nexport var columnMenuFilterAfterOrEqualOperator = 'columnMenu.filterAfterOrEqualOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterAfterOperator = 'columnMenu.filterAfterOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterBeforeOperator = 'columnMenu.filterBeforeOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterBeforeOrEqualOperator = 'columnMenu.filterBeforeOrEqualOperator';\n/**\n * @hidden\n */\nexport var columnMenuFilterAndLogic = 'columnMenu.filterAndLogic';\n/**\n * @hidden\n */\nexport var columnMenuFilterOrLogic = 'columnMenu.filterOrLogic';\n/**\n * @hidden\n */\nexport var sortAriaLabel = 'sort.ariaLabel';\n/**\n * @hidden\n */\nexport var filterAriaLabel = 'filter.ariaLabel';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[pagerItemPerPage] = 'items per page',\n _a[pagerPageSelection] = 'Select page',\n _a[pagerInfo] = '{0} - {1} of {2} items',\n _a[pagerFirstPage] = 'Go to the first page',\n _a[pagerPreviousPage] = 'Go to the previous page',\n _a[pagerNextPage] = 'Go to the next page',\n _a[pagerLastPage] = 'Go to the last page',\n _a[pagerPage] = 'Page',\n _a[pagerOf] = 'of',\n _a[pagerTotalPages] = '{0}',\n _a[pagerPageNumberLabel] = 'Page',\n _a[pagerAriaKeyshortcuts] = 'Enter ArrowRight ArrowLeft',\n _a[pagerAriaLabel] = 'Pager',\n _a[pagerPageSizeAriaLabel] = 'Page size',\n _a[pagerMobileSelect] = 'Select',\n _a[pagerMoreButtonLabel] = 'More pages',\n _a[sortAriaLabel] = 'Sortable',\n _a[filterAriaLabel] = 'Filter',\n _a[filterEqOperator] = 'Is equal to',\n _a[filterNotEqOperator] = 'Is not equal to',\n _a[filterIsNullOperator] = 'Is null',\n _a[filterIsNotNullOperator] = 'Is not null',\n _a[filterIsEmptyOperator] = 'Is empty',\n _a[filterIsNotEmptyOperator] = 'Is not empty',\n _a[filterStartsWithOperator] = 'Starts with',\n _a[filterContainsOperator] = 'Contains',\n _a[filterNotContainsOperator] = 'Does not contain',\n _a[filterEndsWithOperator] = 'Ends with',\n _a[filterGteOperator] = 'Is greater than or equal to',\n _a[filterGtOperator] = 'Is greater than',\n _a[filterLteOperator] = 'Is less than or equal to',\n _a[filterLtOperator] = 'Is less than',\n _a[filterIsTrue] = 'Is true',\n _a[filterIsFalse] = 'Is false',\n _a[filterAfterOrEqualOperator] = 'Is after or equal to',\n _a[filterAfterOperator] = 'Is after',\n _a[filterBeforeOperator] = 'Is before',\n _a[filterBeforeOrEqualOperator] = 'Is before or equal to',\n _a[filterAndLogic] = 'And',\n _a[filterOrLogic] = 'Or',\n _a[filterAddExpression] = 'Add Expression',\n _a[filterAddGroup] = 'Add Group',\n _a[filterClose] = 'Close',\n _a[filterGroupAriaLabel] = 'Filter toolbar',\n _a[filterExpressionAriaLabel] = 'Filter expression row',\n _a[filterExpressionDropdownAriaLabel] = 'Filter dropdown',\n _a[filterExpressionOperatorDropdownAriaLabel] = 'Filter operator dropdown',\n _a[filterEnumFilterDropdownAriaLabel] = 'Select True/False',\n _a[filterNumericFilterAriaLabel] = 'Enter number',\n _a[filterTextFilterAriaLabel] = 'Enter text',\n _a[columnMenuFilterClearButton] = 'Clear',\n _a[columnMenuFilterSubmitButton] = 'Filter',\n _a[columnMenuFilterTitle] = 'Filter',\n _a[columnMenuSortAscending] = 'Sort Ascending',\n _a[columnMenuSortDescending] = 'Sort Descending',\n _a[columnMenuFilterEqOperator] = 'Is equal to',\n _a[columnMenuFilterNotEqOperator] = 'Is not equal to',\n _a[columnMenuFilterIsNullOperator] = 'Is null',\n _a[columnMenuFilterIsNotNullOperator] = 'Is not null',\n _a[columnMenuFilterIsEmptyOperator] = 'Is empty',\n _a[columnMenuFilterIsNotEmptyOperator] = 'Is not empty',\n _a[columnMenuFilterStartsWithOperator] = 'Starts with',\n _a[columnMenuFilterContainsOperator] = 'Contains',\n _a[columnMenuFilterNotContainsOperator] = 'Does not contain',\n _a[columnMenuFilterEndsWithOperator] = 'Ends with',\n _a[columnMenuFilterGteOperator] = 'Is greater than or equal to',\n _a[columnMenuFilterGtOperator] = 'Is greater than',\n _a[columnMenuFilterLteOperator] = 'Is less than or equal to',\n _a[columnMenuFilterLtOperator] = 'Is less than',\n _a[columnMenuFilterIsTrue] = 'Is true',\n _a[columnMenuFilterAfterOrEqualOperator] = 'Is after or equal to',\n _a[columnMenuFilterAfterOperator] = 'Is after',\n _a[columnMenuFilterBeforeOperator] = 'Is before',\n _a[columnMenuFilterBeforeOrEqualOperator] = 'Is before or equal to',\n _a[columnMenuFilterAndLogic] = 'And',\n _a[columnMenuFilterOrLogic] = 'Or',\n _a);\n","var defaultData = {\n en: {\n name: \"en\",\n identity: {\n version: {\n _unicodeVersion: \"14.0.0\",\n _cldrVersion: \"41\"\n },\n language: \"en\"\n },\n territory: \"US\",\n numbers: {\n symbols: {\n decimal: \".\",\n group: \",\",\n list: \";\",\n percentSign: \"%\",\n plusSign: \"+\",\n minusSign: \"-\",\n exponential: \"E\",\n superscriptingExponent: \"×\",\n perMille: \"‰\",\n infinity: \"∞\",\n nan: \"NaN\",\n timeSeparator: \":\",\n approximatelySign: \"~\"\n },\n decimal: {\n patterns: [\n \"n\"\n ],\n groupSize: [\n 3\n ]\n },\n scientific: {\n patterns: [\n \"nEn\"\n ],\n groupSize: []\n },\n percent: {\n patterns: [\n \"n%\"\n ],\n groupSize: [\n 3\n ]\n },\n currency: {\n patterns: [\n \"$n\"\n ],\n groupSize: [\n 3\n ],\n \"unitPattern-count-one\": \"n $\",\n \"unitPattern-count-other\": \"n $\"\n },\n currencies: {\n BGN: {\n displayName: \"Bulgarian Lev\",\n \"displayName-count-one\": \"Bulgarian lev\",\n \"displayName-count-other\": \"Bulgarian leva\",\n symbol: \"BGN\"\n },\n EUR: {\n displayName: \"Euro\",\n \"displayName-count-one\": \"euro\",\n \"displayName-count-other\": \"euros\",\n symbol: \"€\",\n \"symbol-alt-narrow\": \"€\"\n },\n USD: {\n displayName: \"US Dollar\",\n \"displayName-count-one\": \"US dollar\",\n \"displayName-count-other\": \"US dollars\",\n symbol: \"$\",\n \"symbol-alt-narrow\": \"$\"\n }\n },\n localeCurrency: \"USD\",\n accounting: {\n patterns: [\n \"$n\",\n \"($n)\"\n ],\n groupSize: [\n 3\n ]\n }\n },\n calendar: {\n gmtFormat: \"GMT{0}\",\n gmtZeroFormat: \"GMT\",\n patterns: {\n d: \"M/d/y\",\n D: \"EEEE, MMMM d, y\",\n m: \"MMM d\",\n M: \"MMMM d\",\n y: \"MMM y\",\n Y: \"MMMM y\",\n F: \"EEEE, MMMM d, y h:mm:ss a\",\n g: \"M/d/y h:mm a\",\n G: \"M/d/y h:mm:ss a\",\n t: \"h:mm a\",\n T: \"h:mm:ss a\",\n s: \"yyyy'-'MM'-'dd'T'HH':'mm':'ss\",\n u: \"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\"\n },\n dateTimeFormats: {\n full: \"{1} 'at' {0}\",\n long: \"{1} 'at' {0}\",\n medium: \"{1}, {0}\",\n short: \"{1}, {0}\",\n availableFormats: {\n Bh: \"h B\",\n Bhm: \"h:mm B\",\n Bhms: \"h:mm:ss B\",\n d: \"d\",\n E: \"ccc\",\n EBhm: \"E h:mm B\",\n EBhms: \"E h:mm:ss B\",\n Ed: \"d E\",\n Ehm: \"E h:mm a\",\n EHm: \"E HH:mm\",\n Ehms: \"E h:mm:ss a\",\n EHms: \"E HH:mm:ss\",\n Gy: \"y G\",\n GyMd: \"M/d/y GGGGG\",\n GyMMM: \"MMM y G\",\n GyMMMd: \"MMM d, y G\",\n GyMMMEd: \"E, MMM d, y G\",\n h: \"h a\",\n H: \"HH\",\n hm: \"h:mm a\",\n Hm: \"HH:mm\",\n hms: \"h:mm:ss a\",\n Hms: \"HH:mm:ss\",\n hmsv: \"h:mm:ss a v\",\n Hmsv: \"HH:mm:ss v\",\n hmv: \"h:mm a v\",\n Hmv: \"HH:mm v\",\n M: \"L\",\n Md: \"M/d\",\n MEd: \"E, M/d\",\n MMM: \"LLL\",\n MMMd: \"MMM d\",\n MMMEd: \"E, MMM d\",\n MMMMd: \"MMMM d\",\n \"MMMMW-count-one\": \"'week' W 'of' MMMM\",\n \"MMMMW-count-other\": \"'week' W 'of' MMMM\",\n ms: \"mm:ss\",\n y: \"y\",\n yM: \"M/y\",\n yMd: \"M/d/y\",\n yMEd: \"E, M/d/y\",\n yMMM: \"MMM y\",\n yMMMd: \"MMM d, y\",\n yMMMEd: \"E, MMM d, y\",\n yMMMM: \"MMMM y\",\n yQQQ: \"QQQ y\",\n yQQQQ: \"QQQQ y\",\n \"yw-count-one\": \"'week' w 'of' Y\",\n \"yw-count-other\": \"'week' w 'of' Y\"\n }\n },\n timeFormats: {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\"\n },\n dateFormats: {\n full: \"EEEE, MMMM d, y\",\n long: \"MMMM d, y\",\n medium: \"MMM d, y\",\n short: \"M/d/yy\"\n },\n days: {\n format: {\n abbreviated: [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n narrow: [\n \"S\",\n \"M\",\n \"T\",\n \"W\",\n \"T\",\n \"F\",\n \"S\"\n ],\n short: [\n \"Su\",\n \"Mo\",\n \"Tu\",\n \"We\",\n \"Th\",\n \"Fr\",\n \"Sa\"\n ],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ]\n },\n \"stand-alone\": {\n abbreviated: [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n narrow: [\n \"S\",\n \"M\",\n \"T\",\n \"W\",\n \"T\",\n \"F\",\n \"S\"\n ],\n short: [\n \"Su\",\n \"Mo\",\n \"Tu\",\n \"We\",\n \"Th\",\n \"Fr\",\n \"Sa\"\n ],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ]\n }\n },\n months: {\n format: {\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n narrow: [\n \"J\",\n \"F\",\n \"M\",\n \"A\",\n \"M\",\n \"J\",\n \"J\",\n \"A\",\n \"S\",\n \"O\",\n \"N\",\n \"D\"\n ],\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ]\n },\n \"stand-alone\": {\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n narrow: [\n \"J\",\n \"F\",\n \"M\",\n \"A\",\n \"M\",\n \"J\",\n \"J\",\n \"A\",\n \"S\",\n \"O\",\n \"N\",\n \"D\"\n ],\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ]\n }\n },\n quarters: {\n format: {\n abbreviated: [\n \"Q1\",\n \"Q2\",\n \"Q3\",\n \"Q4\"\n ],\n narrow: [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\n wide: [\n \"1st quarter\",\n \"2nd quarter\",\n \"3rd quarter\",\n \"4th quarter\"\n ]\n },\n \"stand-alone\": {\n abbreviated: [\n \"Q1\",\n \"Q2\",\n \"Q3\",\n \"Q4\"\n ],\n narrow: [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\n wide: [\n \"1st quarter\",\n \"2nd quarter\",\n \"3rd quarter\",\n \"4th quarter\"\n ]\n }\n },\n dayPeriods: {\n format: {\n abbreviated: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n },\n narrow: {\n midnight: \"mi\",\n am: \"a\",\n \"am-alt-variant\": \"am\",\n noon: \"n\",\n pm: \"p\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n },\n wide: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n }\n },\n \"stand-alone\": {\n abbreviated: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n },\n narrow: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n },\n wide: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n }\n }\n },\n eras: {\n format: {\n wide: {\n \"0\": \"Before Christ\",\n \"1\": \"Anno Domini\",\n \"0-alt-variant\": \"Before Common Era\",\n \"1-alt-variant\": \"Common Era\"\n },\n abbreviated: {\n \"0\": \"BC\",\n \"1\": \"AD\",\n \"0-alt-variant\": \"BCE\",\n \"1-alt-variant\": \"CE\"\n },\n narrow: {\n \"0\": \"B\",\n \"1\": \"A\",\n \"0-alt-variant\": \"BCE\",\n \"1-alt-variant\": \"CE\"\n }\n }\n },\n dateFields: {\n era: {\n wide: \"era\",\n short: \"era\",\n narrow: \"era\"\n },\n year: {\n wide: \"year\",\n short: \"yr.\",\n narrow: \"yr.\"\n },\n quarter: {\n wide: \"quarter\",\n short: \"qtr.\",\n narrow: \"qtr.\"\n },\n month: {\n wide: \"month\",\n short: \"mo.\",\n narrow: \"mo.\"\n },\n week: {\n wide: \"week\",\n short: \"wk.\",\n narrow: \"wk.\"\n },\n weekOfMonth: {\n wide: \"week of month\",\n short: \"wk. of mo.\",\n narrow: \"wk. of mo.\"\n },\n day: {\n wide: \"day\",\n short: \"day\",\n narrow: \"day\"\n },\n dayOfYear: {\n wide: \"day of year\",\n short: \"day of yr.\",\n narrow: \"day of yr.\"\n },\n weekday: {\n wide: \"day of the week\",\n short: \"day of wk.\",\n narrow: \"day of wk.\"\n },\n weekdayOfMonth: {\n wide: \"weekday of the month\",\n short: \"wkday. of mo.\",\n narrow: \"wkday. of mo.\"\n },\n dayperiod: {\n short: \"AM/PM\",\n wide: \"AM/PM\",\n narrow: \"AM/PM\"\n },\n hour: {\n wide: \"hour\",\n short: \"hr.\",\n narrow: \"hr.\"\n },\n minute: {\n wide: \"minute\",\n short: \"min.\",\n narrow: \"min.\"\n },\n second: {\n wide: \"second\",\n short: \"sec.\",\n narrow: \"sec.\"\n },\n zone: {\n wide: \"time zone\",\n short: \"zone\",\n narrow: \"zone\"\n },\n millisecond: {\n narrow: \"ms\",\n short: \"ms\",\n wide: \"millisecond\"\n }\n }\n }\n },\n supplemental: {\n likelySubtags: {\n en: \"en-Latn-US\"\n },\n currencyData: {\n region: {\n US: [\n {\n USD: {\n _from: \"1792-01-01\"\n }\n }\n ]\n }\n },\n weekData: {\n firstDay: {\n US: \"sun\"\n },\n weekendStart: {\n \"001\": \"sat\"\n },\n weekendEnd: {\n \"001\": \"sun\"\n }\n }\n }\n};\nexport default defaultData;","export default function isString(value) {\n return typeof value === \"string\";\n}","//The error is represented by unique name and corresponding message\n//The message can contain placeholders with index, e.g. {0}, {1}\n\nexport default {\n \"NoLocale\": \"Missing locale info for '{0}'\",\n \"NoCurrency\": \"Cannot determine currency information. Please load the locale currencies data.\",\n \"NoSupplementalCurrency\": \"Cannot determine currency. Please load the supplemental currencyData.\",\n \"NoCurrencyRegion\": \"No currency data for region '{0}'\",\n \"NoCurrencyDisplay\": \"Cannot determine currency display information. Please load the locale currencies data. The default culture does not include the all currencies data.\",\n \"NoGMTInfo\": \"Cannot determine locale GMT format. Please load the locale timeZoneNames data.\",\n \"NoWeekData\": \"Cannot determine locale first day of week. Please load the supplemental weekData.\",\n \"NoFirstDay\": \"Cannot determine locale first day of week. Please load the supplemental weekData. The default culture includes only the 'en-US' first day info.\",\n \"NoValidCurrency\": \"Cannot determine a default currency for the {0} locale. Please specify explicitly the currency with the format options.\",\n \"NoDateFieldNames\": \"Cannot determine the locale date field names. Please load the locale dateFields data.\"\n};\n","import errorDetails from './error-details';\n\nvar formatRegExp = /\\{(\\d+)}?\\}/g;\n\nvar IntlError = function IntlError(ref) {\n var name = ref.name;\n var message = ref.message;\n\n if (!name || !message) {\n throw new Error(\"{ name: string, message: string } object is required!\");\n }\n\n this.name = name;\n this.message = message;\n};\n\nIntlError.prototype.formatMessage = function formatMessage () {\n var values = [], len = arguments.length;\n while ( len-- ) values[ len ] = arguments[ len ];\n\n var flattenValues = flatten(values);\n\n var formattedMessage = this.message.replace(formatRegExp, function(match, index) {\n return flattenValues[parseInt(index, 10)];\n });\n\n return ((this.name) + \": \" + formattedMessage);\n};\n\nIntlError.prototype.error = function error () {\n var values = [], len = arguments.length;\n while ( len-- ) values[ len ] = arguments[ len ];\n\n return new Error(this.formatMessage(values));\n};\n\nvar flatten = function(arr) {\n return arr.reduce(function (a, b) { return a.concat(b); }, []);\n};\n\nvar toIntlErrors = function(errors) {\n var predicate = function(prev, name) {\n prev[name] = new IntlError({ name: name, message: errors[name] });\n return prev;\n };\n\n return Object.keys(errors).reduce(predicate, {});\n};\n\nvar errors = toIntlErrors(errorDetails);\n\nexport {\n errors,\n IntlError,\n toIntlErrors\n};\n","import defaultData from './default-data';\nimport isString from '../common/is-string';\nimport { errors } from '../errors';\n\nfunction availableLocaleInfo(fullName, suffixes) {\n var parts = fullName.split(\"-\");\n var language = parts[0];\n var script = parts[1];\n var territory = parts[2];\n\n return cldr[fullName] || (suffixes.indexOf(territory) !== -1 && cldr[language + \"-\" + territory]) || (suffixes.indexOf(script) !== -1 && cldr[language + \"-\" + script]) || cldr[language];\n}\n\nfunction localeFullName(language, suffixes) {\n var likelySubtags = cldr.supplemental.likelySubtags;\n\n for (var idx = 0; idx < suffixes.length; idx++) {\n var name = likelySubtags[language + \"-\" + suffixes[idx ]];\n if (name) {\n return name;\n }\n }\n\n if (likelySubtags[language]) {\n return likelySubtags[language];\n }\n}\n\nexport var cldr = defaultData;\n\nexport function getLocaleInfo(locale) {\n var info;\n if (isString(locale)) {\n info = localeInfo(locale);\n } else {\n info = locale;\n }\n return info;\n}\n\nexport function localeInfo(locale) {\n if (cldr[locale]) {\n return cldr[locale];\n }\n\n var likelySubtags = cldr.supplemental.likelySubtags;\n if (likelySubtags) {\n var parts = locale.split(\"-\");\n var language = parts[0];\n var suffixes = parts.slice(1);\n var fullName = localeFullName(language, suffixes);\n var info = fullName ? availableLocaleInfo(fullName, suffixes) : null;\n if (info) {\n return info;\n }\n }\n\n throw errors.NoLocale.error(locale);\n}\n","export var DECIMAL = \"decimal\";\nexport var CURRENCY = \"currency\";\nexport var ACCOUNTING = \"accounting\";\nexport var PERCENT = \"percent\";\nexport var SCIENTIFIC = \"scientific\";\n\nexport var CURRENCY_PLACEHOLDER = \"$\";\nexport var PERCENT_PLACEHOLDER = \"%\";\nexport var NUMBER_PLACEHOLDER = \"n\";\n\nexport var LIST_SEPARATOR = \";\";\nexport var GROUP_SEPARATOR = \",\";\n\nexport var POINT = \".\";\nexport var EMPTY = \"\";\n\nexport var DEFAULT_LOCALE = \"en\";\n\n","import { cldr } from './info';\n\nfunction territoryFromName(name, identity) {\n var likelySubtags = cldr.supplemental.likelySubtags;\n var parts = name.split(\"-\");\n if (likelySubtags) {\n var likelyName = likelySubtags[name] || likelySubtags[parts[0]];\n if (likelyName) {\n parts = likelyName.split(\"-\");\n }\n }\n\n if (identity) {\n for (var idx = parts.length - 1; idx >= 1; idx--) {\n var part = parts[idx];\n if (part === identity.variant || part === identity.script) {\n parts.splice(idx, 1);\n }\n }\n }\n\n var length = parts.length;\n\n if (length > 1) {\n var territory = parts[length - 1];\n return territory.toUpperCase();\n }\n}\n\nexport default function localeTerritory(info) {\n if (info.territory) {\n return info.territory;\n }\n\n var name = info.name;\n var identity = info.identity;\n var territory;\n\n if (identity && identity.territory) {\n territory = identity.territory;\n } else {\n territory = territoryFromName(name, identity);\n }\n\n info.territory = territory;\n\n return territory;\n}\n","import { localeInfo } from './info';\nimport { errors } from '../errors';\nimport { DEFAULT_LOCALE } from '../common/constants';\n\nexport default function dateFieldName(options, locale) {\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n\n var info = localeInfo(locale);\n var dateFields = info.calendar.dateFields;\n if (!dateFields) {\n throw errors.NoDateFieldNames.error();\n }\n\n var fieldNameInfo = dateFields[options.type] || {};\n\n return fieldNameInfo[options.nameType] || fieldNameInfo['wide'];\n}\n","import { getLocaleInfo } from './info';\nimport { EMPTY } from '../common/constants';\n\nfunction lowerArray(arr) {\n var result = [];\n for (var idx = 0; idx < arr.length; idx++) {\n result.push(arr[idx].toLowerCase());\n }\n return result;\n}\n\nfunction lowerObject(obj) {\n var result = {};\n for (var field in obj) {\n result[field] = obj[field].toLowerCase();\n }\n return result;\n}\n\nfunction cloneLower(obj) {\n var result = Array.isArray(obj) ? lowerArray(obj) : lowerObject(obj);\n return result;\n}\n\nexport default function dateFormatNames(locale, options) {\n var type = options.type;\n var nameType = options.nameType;\n var standAlone = options.standAlone;\n var lower = options.lower;\n var info = getLocaleInfo(locale);\n var formatType = standAlone ? \"stand-alone\" : \"format\";\n var lowerNameType = (lower ? \"lower-\" : EMPTY) + nameType;\n var formatNames = info.calendar[type][formatType];\n var result = formatNames[lowerNameType];\n if (!result && lower) {\n result = formatNames[lowerNameType] = cloneLower(formatNames[nameType]);\n }\n return result;\n}","export default function parseRangeDate(value) {\n var parts = value.split('-');\n var year = parseInt(parts[0], 10);\n var month = parseInt(parts[1], 10) - 1;\n var day = parseInt(parts[2], 10);\n\n return new Date(year, month, day);\n}\n","import { cldr, getLocaleInfo } from './info';\nimport { errors } from '../errors';\nimport localeTerritory from './territory';\nimport parseRangeDate from './parse-range-date';\n\n/* eslint-disable consistent-return */\n\nvar NoCurrency = errors.NoCurrency;\nvar NoCurrencyDisplay = errors.NoCurrencyDisplay;\nvar NoSupplementalCurrency = errors.NoSupplementalCurrency;\nvar NoCurrencyRegion = errors.NoCurrencyRegion;\nvar NoValidCurrency = errors.NoValidCurrency;\n\nvar DEFAULT_CURRENCY_FRACTIONS = 2;\nvar SYMBOL = \"symbol\";\nvar INVALID_CURRENCY_CODE = 'XXX';\n\nvar GLOBAL_CURRENCIES = {\n '001': 'USD', // 001 refers to world. not sure if it is correct to assume USD but seems better than throw an error\n '150': 'EUR' // 150 territory for Europe\n\n};\n\nfunction getCurrencyInfo(locale, currency, throwIfNoValid) {\n var info = getLocaleInfo(locale);\n var currencies = info.numbers.currencies;\n if (!currencies) {\n if (throwIfNoValid) {\n throw NoCurrency.error();\n }\n\n return;\n }\n\n var currencyDisplayInfo = currencies[currency];\n\n if (!currencyDisplayInfo) {\n if (throwIfNoValid) {\n throw NoCurrencyDisplay.error();\n }\n\n return;\n }\n\n return currencyDisplayInfo;\n}\n\nfunction lengthComparer(a, b) {\n return b.length - a.length;\n}\n\nfunction regionCurrency(regionCurrencies) {\n var latestValidUntil, latestValidUntilRange;\n var latestStillValid, latestStillValidDate;\n\n for (var idx = 0; idx < regionCurrencies.length; idx++) {\n var currency = regionCurrencies[idx];\n var code = Object.keys(currency)[0];\n var info = currency[code];\n if (code !== INVALID_CURRENCY_CODE && info._tender !== 'false' && info._from) {\n if (!info._to) {\n var stillValidDate = parseRangeDate(info._from);\n if (!latestStillValidDate || latestStillValidDate < stillValidDate) {\n latestStillValid = code;\n latestStillValidDate = stillValidDate;\n }\n } else if (!latestStillValid) {\n var validFrom = parseRangeDate(info._from);\n var validTo = parseRangeDate(info._to);\n if (!latestValidUntilRange || latestValidUntilRange.to < validTo || latestValidUntilRange.from < validFrom) {\n latestValidUntil = code;\n latestValidUntilRange = {\n from: validFrom,\n to: validTo\n };\n }\n }\n }\n }\n\n return latestStillValid || latestValidUntil;\n}\n\nexport function currencyDisplays(locale, currency, throwIfNoValid) {\n if ( throwIfNoValid === void 0 ) throwIfNoValid = true;\n\n var currencyInfo = getCurrencyInfo(locale, currency, throwIfNoValid);\n if (!currencyInfo) {\n return;\n }\n\n if (!currencyInfo.displays) {\n var displays = [ currency ];\n for (var field in currencyInfo) {\n displays.push(currencyInfo[field]);\n }\n displays.sort(lengthComparer);\n currencyInfo.displays = displays;\n }\n\n return currencyInfo.displays;\n}\n\nexport function currencyDisplay(locale, options) {\n var value = options.value;\n var currency = options.currency;\n var currencyDisplay = options.currencyDisplay; if ( currencyDisplay === void 0 ) currencyDisplay = SYMBOL;\n\n if (currencyDisplay === \"code\") {\n return currency;\n }\n\n var currencyInfo = getCurrencyInfo(locale, currency, true);\n var result;\n\n if (currencyDisplay === SYMBOL) {\n result = currencyInfo[\"symbol-alt-narrow\"] || currencyInfo[SYMBOL] || currency;\n } else {\n if (typeof value === \"undefined\" || value !== 1) {\n result = currencyInfo[\"displayName-count-other\"];\n } else {\n result = currencyInfo[\"displayName-count-one\"];\n }\n }\n\n return result;\n}\n\nexport function currencyFractionOptions(code) {\n var minimumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;\n var maximumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;\n\n var fractions = ((cldr.supplemental.currencyData || {}).fractions || {})[code];\n\n if (fractions && fractions._digits) {\n maximumFractionDigits = minimumFractionDigits = parseInt(fractions._digits, 10);\n }\n\n return {\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits\n };\n}\n\nexport function territoryCurrencyCode(territory, throwIfNoValid) {\n if ( throwIfNoValid === void 0 ) throwIfNoValid = true;\n\n if (GLOBAL_CURRENCIES[territory]) {\n return GLOBAL_CURRENCIES[territory];\n }\n\n var currencyData = cldr.supplemental.currencyData;\n if (!currencyData) {\n if (throwIfNoValid) {\n throw NoSupplementalCurrency.error();\n }\n\n return;\n }\n\n var regionCurrencies = currencyData.region[territory];\n\n if (!regionCurrencies) {\n if (throwIfNoValid) {\n throw NoCurrencyRegion.error(territory);\n }\n\n return;\n }\n\n var currencyCode = regionCurrency(regionCurrencies);\n\n return currencyCode;\n}\n\nexport function localeCurrency(locale, throwIfNoValid) {\n var info = getLocaleInfo(locale);\n var numbers = info.numbers;\n\n if (!numbers.localeCurrency) {\n var currency = territoryCurrencyCode(localeTerritory(info), throwIfNoValid);\n\n if (!currency && throwIfNoValid) {\n throw NoValidCurrency.error(info.name);\n }\n\n numbers.localeCurrency = currency;\n }\n\n return numbers.localeCurrency;\n}\n","\nexport var DAYS_OF_WEEK = [ \"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\" ];\n\nexport var DEFAULT_TERRITORY = '001';\n","import { cldr, getLocaleInfo } from './info';\nimport localeTerritory from './territory';\n\nimport { DAYS_OF_WEEK, DEFAULT_TERRITORY } from './constants';\nimport { errors } from '../errors';\n\nvar NoWeekData = errors.NoWeekData;\nvar NoFirstDay = errors.NoFirstDay;\n\nexport default function firstDay(locale) {\n var info = getLocaleInfo(locale);\n\n if (!isNaN(info.firstDay)) {\n return info.firstDay;\n }\n\n var weekData = cldr.supplemental.weekData;\n if (!weekData) {\n throw NoWeekData.error();\n }\n\n var firstDay = weekData.firstDay[localeTerritory(info)] || weekData.firstDay[DEFAULT_TERRITORY];\n\n if (!firstDay) {\n throw NoFirstDay.error();\n }\n\n info.firstDay = DAYS_OF_WEEK.indexOf(firstDay);\n\n return info.firstDay;\n}\n","import { cldr, getLocaleInfo } from './info';\nimport localeTerritory from './territory';\n\nimport { DAYS_OF_WEEK, DEFAULT_TERRITORY } from './constants';\nimport { errors } from '../errors';\n\nvar NoWeekData = errors.NoWeekData;\n\nexport default function weekendRange(locale) {\n var info = getLocaleInfo(locale);\n\n if (info.weekendRange) {\n return info.weekendRange;\n }\n\n var weekData = cldr.supplemental.weekData;\n if (!weekData) {\n throw NoWeekData.error();\n }\n\n var territory = localeTerritory(info);\n var start = weekData.weekendStart[territory] || weekData.weekendStart[DEFAULT_TERRITORY];\n var end = weekData.weekendEnd[territory] || weekData.weekendEnd[DEFAULT_TERRITORY];\n\n info.weekendRange = {\n start: DAYS_OF_WEEK.indexOf(start),\n end: DAYS_OF_WEEK.indexOf(end)\n };\n\n return info.weekendRange;\n}\n","import { getLocaleInfo } from './info';\n\nexport default function numberSymbols(locale) {\n var info = getLocaleInfo(locale);\n\n return info.numbers.symbols;\n}","export default function isNegativeZero(value) {\n return (1 / value === -Infinity);\n}\n","import { currencyDisplay, localeCurrency } from '../cldr';\n\nexport default function formatCurrencySymbol(info, options) {\n if ( options === void 0 ) options = {};\n\n if (!options.currency) {\n options.currency = localeCurrency(info, true);\n }\n\n var display = currencyDisplay(info, options);\n\n return display;\n}\n","export default function groupInteger(number, start, end, options, info) {\n var symbols = info.numbers.symbols;\n var decimalIndex = number.indexOf(symbols.decimal);\n var groupSizes = options.groupSize.slice();\n var groupSize = groupSizes.shift();\n\n var integerEnd = decimalIndex !== -1 ? decimalIndex : end + 1;\n\n var integer = number.substring(start, integerEnd);\n var result = number;\n var integerLength = integer.length;\n\n if (integerLength >= groupSize) {\n var idx = integerLength;\n var parts = [];\n\n while (idx > -1) {\n var value = integer.substring(idx - groupSize, idx);\n if (value) {\n parts.push(value);\n }\n idx -= groupSize;\n var newGroupSize = groupSizes.shift();\n groupSize = newGroupSize !== undefined ? newGroupSize : groupSize;\n\n if (groupSize === 0) {\n value = integer.substring(0, idx);\n if (value) {\n parts.push(value);\n }\n break;\n }\n }\n\n integer = parts.reverse().join(symbols.group);\n result = number.substring(0, start) + integer + number.substring(integerEnd);\n }\n\n return result;\n}","import { CURRENCY, ACCOUNTING } from '../common/constants';\n\nexport default function isCurrencyStyle(style) {\n return style === CURRENCY || style === ACCOUNTING;\n}","export default function pad(number, digits, right) {\n if ( digits === void 0 ) digits = 2;\n if ( right === void 0 ) right = false;\n\n var count = digits - String(number).length;\n var result = number;\n\n if (count > 0) {\n var padString = new Array(count + 1).join(\"0\");\n result = right ? number + padString : padString + number;\n }\n\n return result;\n}","var MAX_PRECISION = 20;\n\nexport default function round(value, precision) {\n var result = value;\n var decimals = precision || 0;\n\n result = result.toString().split('e');\n result = Math.round(Number(result[0] + 'e' + (result[1] ? (Number(result[1]) + decimals) : decimals)));\n\n result = result.toString().split('e');\n result = Number(result[0] + 'e' + (result[1] ? (Number(result[1]) - decimals) : -decimals));\n\n return result.toFixed(Math.min(decimals, MAX_PRECISION));\n}","import { PERCENT, SCIENTIFIC, NUMBER_PLACEHOLDER, CURRENCY_PLACEHOLDER, PERCENT_PLACEHOLDER, EMPTY, POINT } from '../common/constants';\nimport isNegativeZero from '../common/is-negative-zero';\nimport formatCurrencySymbol from './format-currency-symbol';\nimport groupInteger from './group-integer';\nimport isCurrencyStyle from './is-currency-style';\nimport pad from '../common/pad';\nimport round from '../common/round';\nimport { currencyFractionOptions } from '../cldr';\n\nvar DEFAULT_DECIMAL_ROUNDING = 3;\nvar DEFAULT_PERCENT_ROUNDING = 0;\n\nvar trailingZeroRegex = /0+$/;\n\nfunction fractionOptions(options) {\n var minimumFractionDigits = options.minimumFractionDigits;\n var maximumFractionDigits = options.maximumFractionDigits;\n var style = options.style;\n var isCurrency = isCurrencyStyle(style);\n var currencyFractions;\n if (isCurrency) {\n currencyFractions = currencyFractionOptions(options.currency);\n }\n\n if (minimumFractionDigits === undefined) {\n minimumFractionDigits = isCurrency ? currencyFractions.minimumFractionDigits : 0;\n }\n\n if (maximumFractionDigits === undefined) {\n if (style === PERCENT) {\n maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_PERCENT_ROUNDING);\n } else if (isCurrency) {\n maximumFractionDigits = Math.max(minimumFractionDigits, currencyFractions.maximumFractionDigits);\n } else {\n maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_DECIMAL_ROUNDING);\n }\n }\n\n return {\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits\n };\n}\n\nfunction applyPattern(value, pattern, symbol) {\n var result = EMPTY;\n for (var idx = 0, length = pattern.length; idx < length; idx++) {\n var ch = pattern.charAt(idx);\n\n if (ch === NUMBER_PLACEHOLDER) {\n result += value;\n } else if (ch === CURRENCY_PLACEHOLDER || ch === PERCENT_PLACEHOLDER) {\n result += symbol;\n } else {\n result += ch;\n }\n }\n return result;\n}\n\nfunction currencyUnitPattern(info, value) {\n var currencyInfo = info.numbers.currency;\n var pattern = value !== 1 ? currencyInfo[\"unitPattern-count-other\"] : currencyInfo[\"unitPattern-count-one\"];\n if (value < 0) {\n pattern = pattern.replace(NUMBER_PLACEHOLDER, (\"-\" + NUMBER_PLACEHOLDER));\n }\n\n return pattern;\n}\n\n\nexport default function standardNumberFormat(number, options, info) {\n var symbols = info.numbers.symbols;\n var style = options.style;\n var isCurrency = isCurrencyStyle(style);\n\n //return number in exponential format\n if (style === SCIENTIFIC) {\n var exponential = options.minimumFractionDigits !== undefined ? number.toExponential(options.minimumFractionDigits) : number.toExponential();\n return exponential.replace(POINT, symbols.decimal);\n }\n\n var value = number;\n var symbol;\n\n if (isCurrency) {\n options.value = value;\n symbol = formatCurrencySymbol(info, options);\n }\n\n if (style === PERCENT) {\n value *= 100;\n symbol = symbols.percentSign;\n }\n\n var ref = fractionOptions(options);\n var minimumFractionDigits = ref.minimumFractionDigits;\n var maximumFractionDigits = ref.maximumFractionDigits;\n\n value = round(value, maximumFractionDigits);\n\n var negative = value < 0;\n var negativeZero = isNegativeZero(number);\n\n var parts = value.split(POINT);\n\n var integer = parts[0];\n var fraction = pad(parts[1] ? parts[1].replace(trailingZeroRegex, EMPTY) : EMPTY, minimumFractionDigits, true);\n\n //exclude \"-\" if number is negative.\n if (negative) {\n integer = integer.substring(1);\n }\n\n if (options.minimumIntegerDigits) {\n integer = pad(integer, options.minimumIntegerDigits);\n }\n\n var formattedValue = options.useGrouping !== false ? groupInteger(integer, 0, integer.length, options, info) : integer;\n\n if (fraction) {\n formattedValue += symbols.decimal + fraction;\n }\n\n var pattern;\n\n if (isCurrency && options.currencyDisplay === \"name\") {\n pattern = currencyUnitPattern(info, number);\n } else {\n var patterns = options.patterns;\n pattern = (negative || negativeZero) ? patterns[1] || (\"-\" + patterns[0]) : patterns[0];\n }\n\n if (pattern === NUMBER_PLACEHOLDER && !negative) {\n return formattedValue;\n }\n\n var result = applyPattern(formattedValue, pattern, symbol);\n\n return result;\n}","import { PERCENT_PLACEHOLDER, CURRENCY_PLACEHOLDER, CURRENCY, PERCENT, EMPTY } from '../common/constants';\nimport formatCurrencySymbol from './format-currency-symbol';\n\nvar literalRegExp = /(\\\\.)|(['][^']*[']?)|([\"][^\"]*[\"]?)/g;\nvar PLACEHOLDER = \"__??__\";\n\nexport function setStyleOptions(formatOptions, info) {\n var format = formatOptions.format;\n\n //multiply number if the format has percent\n if (format.indexOf(PERCENT_PLACEHOLDER) !== -1) {\n formatOptions.style = PERCENT;\n formatOptions.symbol = info.numbers.symbols.percentSign;\n formatOptions.number *= 100;\n }\n\n if (format.indexOf(CURRENCY_PLACEHOLDER) !== -1) {\n formatOptions.style = CURRENCY;\n formatOptions.symbol = formatCurrencySymbol(info);\n }\n}\n\nexport function setFormatLiterals(formatOptions) {\n var format = formatOptions.format;\n if (format.indexOf(\"'\") > -1 || format.indexOf(\"\\\"\") > -1 || format.indexOf(\"\\\\\") > -1) {\n var literals = formatOptions.literals = [];\n formatOptions.format = format.replace(literalRegExp, function(match) {\n var quoteChar = match.charAt(0).replace(\"\\\\\", EMPTY);\n var literal = match.slice(1).replace(quoteChar, EMPTY);\n\n literals.push(literal);\n\n return PLACEHOLDER;\n });\n }\n}\n\nexport function replaceLiterals(number, literals) {\n var result = number;\n if (literals) {\n var length = literals.length;\n for (var idx = 0; idx < length; idx++) {\n result = result.replace(PLACEHOLDER, literals[idx]);\n }\n }\n return result;\n}","import { CURRENCY, PERCENT, LIST_SEPARATOR, GROUP_SEPARATOR, CURRENCY_PLACEHOLDER, PERCENT_PLACEHOLDER, POINT, EMPTY } from '../common/constants';\nimport isNegativeZero from '../common/is-negative-zero';\nimport groupInteger from './group-integer';\nimport round from '../common/round';\nimport { setStyleOptions, setFormatLiterals, replaceLiterals } from './utils';\n\nvar SHARP = \"#\";\nvar ZERO = \"0\";\n\nvar trailingZerosRegExp = /(\\.(?:[0-9]*[1-9])?)0+$/g;\nvar trailingPointRegExp = /\\.$/;\nvar commaRegExp = /,/g;\n\nfunction trimTrailingZeros(value, lastZero) {\n var trimRegex;\n\n if (lastZero === 0) {\n trimRegex = trailingZerosRegExp;\n } else {\n trimRegex = new RegExp((\"(\\\\.[0-9]{\" + lastZero + \"}[1-9]*)0+$\"), 'g');\n }\n\n return value.replace(trimRegex, '$1').replace(trailingPointRegExp, EMPTY);\n}\n\nfunction roundNumber(formatOptions) {\n var number = formatOptions.number;\n var format = formatOptions.format;\n var decimalIndex = format.indexOf(POINT);\n\n if (decimalIndex !== -1) {\n var zeroIndex = format.lastIndexOf(ZERO) - decimalIndex;\n var sharpIndex = format.lastIndexOf(SHARP) - decimalIndex;\n var hasZero = zeroIndex > -1;\n var hasSharp = sharpIndex > -1;\n var fraction = number.toString().split(\"e\");\n\n if (fraction[1]) {\n fraction = round(number, Math.abs(fraction[1]));\n } else {\n fraction = fraction[0];\n }\n fraction = fraction.split(POINT)[1] || EMPTY;\n\n var precision = fraction.length;\n var trailingZeros = -1;\n\n if (!hasZero && !hasSharp) {\n formatOptions.format = format.substring(0, decimalIndex) + format.substring(decimalIndex + 1);\n decimalIndex = -1;\n precision = 0;\n } else if (hasZero && zeroIndex > sharpIndex) {\n precision = zeroIndex;\n } else if (sharpIndex > zeroIndex) {\n if (hasSharp && precision > sharpIndex) {\n precision = sharpIndex;\n } else if (hasZero && precision < zeroIndex) {\n precision = zeroIndex;\n }\n\n trailingZeros = hasZero ? zeroIndex : 0;\n }\n\n if (precision > -1) {\n number = round(number, precision);\n if (trailingZeros > -1) {\n number = trimTrailingZeros(number, trailingZeros);\n }\n }\n } else {\n number = round(number);\n }\n\n if (formatOptions.negative && (number * -1) >= 0 && !formatOptions.negativeZero) {\n formatOptions.negative = false;\n }\n\n formatOptions.number = number;\n formatOptions.decimalIndex = decimalIndex;\n}\n\nfunction isConstantFormat(format) {\n return format.indexOf(SHARP) === -1 && format.indexOf(ZERO) === -1;\n}\n\nfunction setValueSpecificFormat(formatOptions) {\n var number = formatOptions.number;\n var format = formatOptions.format;\n format = format.split(LIST_SEPARATOR);\n if ((formatOptions.negative || formatOptions.negativeZero) && format[1]) {\n format = format[1];\n formatOptions.hasNegativeFormat = true;\n } else if (number === 0) {\n var zeroFormat = format[2];\n format = zeroFormat || format[0];\n if (zeroFormat && isConstantFormat(zeroFormat)) {\n formatOptions.constant = zeroFormat;\n }\n } else {\n format = format[0];\n }\n\n formatOptions.format = format;\n}\n\nfunction setGroupOptions(formatOptions) {\n formatOptions.hasGroup = formatOptions.format.indexOf(GROUP_SEPARATOR) > -1;\n if (formatOptions.hasGroup) {\n formatOptions.format = formatOptions.format.replace(commaRegExp, EMPTY);\n }\n}\n\nfunction placeholderIndex(index1, index2, start) {\n var index;\n if (index1 === -1 && index2 !== -1) {\n index = index2;\n } else if (index1 !== -1 && index2 === -1) {\n index = index1;\n } else {\n index = start ? Math.min(index1, index2) : Math.max(index1, index2);\n }\n return index;\n}\n\nfunction setPlaceholderIndices(formatOptions) {\n var format = formatOptions.format;\n var sharpIndex = format.indexOf(SHARP);\n var zeroIndex = format.indexOf(ZERO);\n\n var start = placeholderIndex(sharpIndex, zeroIndex, true);\n\n sharpIndex = format.lastIndexOf(SHARP);\n zeroIndex = format.lastIndexOf(ZERO);\n\n var end = placeholderIndex(sharpIndex, zeroIndex);\n\n if (start === format.length) {\n end = start;\n }\n\n formatOptions.start = start;\n formatOptions.end = end;\n formatOptions.lastZeroIndex = zeroIndex;\n}\n\nfunction replaceStyleSymbols(number, style, symbol) {\n var result = number;\n if (style === CURRENCY || style === PERCENT) {\n result = EMPTY;\n for (var idx = 0, length = number.length; idx < length; idx++) {\n var ch = number.charAt(idx);\n result += (ch === CURRENCY_PLACEHOLDER || ch === PERCENT_PLACEHOLDER) ? symbol : ch;\n }\n }\n return result;\n}\n\nfunction replacePlaceHolders(formatOptions, info) {\n var start = formatOptions.start;\n var end = formatOptions.end;\n var negative = formatOptions.negative;\n var negativeZero = formatOptions.negativeZero;\n var format = formatOptions.format;\n var decimalIndex = formatOptions.decimalIndex;\n var lastZeroIndex = formatOptions.lastZeroIndex;\n var hasNegativeFormat = formatOptions.hasNegativeFormat;\n var hasGroup = formatOptions.hasGroup;\n var number = formatOptions.number;\n var value = number.toString().split(POINT);\n var length = format.length;\n var integer = value[0];\n var fraction = value[1] || EMPTY;\n var integerLength = integer.length;\n var replacement = EMPTY;\n\n number = format.substring(0, start);\n\n if ((negative || negativeZero) && !hasNegativeFormat) {\n number += \"-\";\n }\n\n for (var idx = start; idx < length; idx++) {\n var ch = format.charAt(idx);\n\n if (decimalIndex === -1) {\n if (end - idx < integerLength) {\n\n number += integer;\n break;\n }\n } else {\n if (lastZeroIndex !== -1 && lastZeroIndex < idx) {\n replacement = EMPTY;\n }\n\n if ((decimalIndex - idx) <= integerLength && decimalIndex - idx > -1) {\n number += integer;\n idx = decimalIndex;\n }\n\n if (decimalIndex === idx) {\n number += (fraction ? info.numbers.symbols.decimal : EMPTY) + fraction;\n idx += end - decimalIndex + 1;\n continue;\n }\n }\n\n if (ch === ZERO) {\n number += ch;\n replacement = ch;\n } else if (ch === SHARP) {\n number += replacement;\n }\n }\n\n if (hasGroup) {\n number = groupInteger(number, start + (negative && !hasNegativeFormat ? 1 : 0), Math.max(end, (integerLength + start)), info.numbers.decimal, info);\n }\n\n if (end >= start) {\n number += format.substring(end + 1);\n }\n\n return number;\n}\n\nfunction applyCustomFormat(formatOptions, info) {\n var number = formatOptions.number;\n if (formatOptions.start !== -1) {\n number = replacePlaceHolders(formatOptions, info);\n number = replaceStyleSymbols(number, formatOptions.style, formatOptions.symbol);\n number = replaceLiterals(number, formatOptions.literals);\n }\n\n return number;\n}\n\nexport default function customNumberFormat(number, format, info) {\n var formatOptions = {\n negative: number < 0,\n number: Math.abs(number),\n negativeZero: isNegativeZero(number),\n format: format\n };\n\n setValueSpecificFormat(formatOptions);\n\n if (formatOptions.constant) {\n return formatOptions.constant;\n }\n\n setFormatLiterals(formatOptions);\n setStyleOptions(formatOptions, info);\n setGroupOptions(formatOptions);\n roundNumber(formatOptions);\n setPlaceholderIndices(formatOptions);\n\n return applyCustomFormat(formatOptions, info);\n}","import { CURRENCY, ACCOUNTING, DECIMAL, PERCENT, SCIENTIFIC } from '../common/constants';\nimport isString from '../common/is-string';\n\nvar standardFormatRegExp = /^(n|c|p|e|a)(\\d*)$/i;\n\nfunction standardFormatOptions(format) {\n var formatAndPrecision = standardFormatRegExp.exec(format);\n\n if (formatAndPrecision) {\n var options = {\n style: DECIMAL\n };\n\n var style = formatAndPrecision[1].toLowerCase();\n\n if (style === \"c\") {\n options.style = CURRENCY;\n } else if (style === \"a\") {\n options.style = ACCOUNTING;\n } else if (style === \"p\") {\n options.style = PERCENT;\n } else if (style === \"e\") {\n options.style = SCIENTIFIC;\n }\n\n if (formatAndPrecision[2]) {\n options.minimumFractionDigits = options.maximumFractionDigits = parseInt(formatAndPrecision[2], 10);\n }\n\n return options;\n }\n}\n\nexport default function formatOptions(format) {\n var options;\n if (isString(format)) {\n options = standardFormatOptions(format);\n } else {\n options = format;\n }\n\n return options;\n}","import { localeInfo } from '../cldr';\nimport { DECIMAL, DEFAULT_LOCALE, NUMBER_PLACEHOLDER, EMPTY } from '../common/constants';\nimport standardNumberFormat from './standard-number-format';\nimport customNumberFormat from './custom-number-format';\nimport formatOptions from './format-options';\n\nexport default function formatNumber(number, format, locale) {\n if ( format === void 0 ) format = NUMBER_PLACEHOLDER;\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n\n if (number === undefined || number === null) {\n return EMPTY;\n }\n\n if (!isFinite(number)) {\n return String(number);\n }\n\n var info = localeInfo(locale);\n var options = formatOptions(format);\n\n var result;\n if (options) {\n var style = options.style || DECIMAL;\n result = standardNumberFormat(number, Object.assign({}, info.numbers[style], options), info);\n } else {\n result = customNumberFormat(number, format, info);\n }\n\n return result;\n}\n","export default function isNumber(value) {\n return typeof value === \"number\";\n}","import { localeInfo, localeCurrency, currencyDisplays } from '../cldr';\nimport { PERCENT, NUMBER_PLACEHOLDER, CURRENCY_PLACEHOLDER, DEFAULT_LOCALE, EMPTY, POINT } from '../common/constants';\nimport { setStyleOptions, setFormatLiterals } from './utils';\nimport isNumber from '../common/is-number';\nimport isCurrencyStyle from './is-currency-style';\nimport formatOptions from './format-options';\nimport isString from '../common/is-string';\n\nvar exponentRegExp = /[eE][-+]?[0-9]+/;\nvar nonBreakingSpaceRegExp = /\\u00A0/g;\n\nfunction cleanNegativePattern(number, patterns) {\n if (patterns.length > 1) {\n var parts = (patterns[1] || EMPTY).replace(CURRENCY_PLACEHOLDER, EMPTY).split(NUMBER_PLACEHOLDER);\n if (number.indexOf(parts[0]) > -1 && number.indexOf(parts[1]) > -1) {\n return number.replace(parts[0], EMPTY).replace(parts[1], EMPTY);\n }\n }\n}\n\nfunction cleanCurrencyNumber(value, info, format) {\n var options = formatOptions(format) || {};\n var isCurrency = isCurrencyStyle(options.style);\n var number = value;\n var negative;\n\n var currency = options.currency || localeCurrency(info, isCurrency);\n\n if (currency) {\n var displays = currencyDisplays(info, currency, isCurrency);\n if (displays) {\n for (var idx = 0; idx < displays.length; idx++) {\n var display = displays[idx];\n if (number.includes(display)) {\n number = number.replace(display, EMPTY);\n isCurrency = true;\n break;\n }\n }\n }\n\n if (isCurrency) {\n var cleanNumber = cleanNegativePattern(number, info.numbers.currency.patterns) ||\n cleanNegativePattern(number, info.numbers.accounting.patterns);\n\n if (cleanNumber) {\n negative = true;\n number = cleanNumber;\n }\n\n }\n }\n\n return {\n number: number,\n negative: negative\n };\n}\n\nfunction cleanLiterals(number, formatOptions) {\n var literals = formatOptions.literals;\n var result = number;\n\n if (literals) {\n for (var idx = 0; idx < literals.length; idx++) {\n result = result.replace(literals[idx], EMPTY);\n }\n }\n\n return result;\n}\n\nfunction divideBy100(number) {\n var strNumber = String(number);\n var pointIndex = strNumber.indexOf(POINT);\n var zeroesCount = 2;\n var result = number / Math.pow(10, zeroesCount);\n\n if (pointIndex === -1 || String(result).length <= strNumber.length + zeroesCount) {\n return result;\n }\n\n var fractionDigits = strNumber.length - pointIndex + 1 + zeroesCount;\n return parseFloat(result.toFixed(fractionDigits));\n}\n\nexport default function parseNumber(value, locale, format) {\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n if ( format === void 0 ) format = {};\n\n if (!value && value !== 0) {\n return null;\n }\n\n if (isNumber(value)) {\n return value;\n }\n\n var info = localeInfo(locale);\n var symbols = info.numbers.symbols;\n\n var number = value.toString();\n var formatOptions = format || {};\n var isPercent;\n\n if (isString(format)) {\n formatOptions = { format: format };\n setFormatLiterals(formatOptions);\n number = cleanLiterals(number, formatOptions);\n\n setStyleOptions(formatOptions, info);\n }\n\n if (formatOptions.style === PERCENT || number.indexOf(symbols.percentSign) > -1) {\n number = number.replace(symbols.percentSign, EMPTY);\n isPercent = true;\n }\n\n if (exponentRegExp.test(number)) {\n number = parseFloat(number.replace(symbols.decimal, POINT));\n return isNaN(number) ? null : number;\n }\n\n var ref = cleanCurrencyNumber(number, info, formatOptions);\n var negativeCurrency = ref.negative;\n var currencyNumber = ref.number;\n number = String(currencyNumber).trim();\n\n var negativeSignIndex = number.indexOf(\"-\");\n if (negativeSignIndex > 0) {\n return null;\n }\n\n var isNegative = negativeSignIndex > -1;\n\n isNegative = negativeCurrency !== undefined ? negativeCurrency : isNegative;\n\n number = number.replace(\"-\", EMPTY)\n .replace(nonBreakingSpaceRegExp, \" \")\n .split(symbols.group.replace(nonBreakingSpaceRegExp, \" \")).join(EMPTY)\n .replace(symbols.decimal, POINT);\n\n number = parseFloat(number);\n\n if (isNaN(number)) {\n number = null;\n } else if (isNegative) {\n number *= -1;\n }\n\n if (number && isPercent) {\n number = divideBy100(number);\n }\n\n return number;\n}\n","var formatRegExp = /\\{(\\d+)}/g;\n\nexport default function formatString(format) {\n var values = arguments;\n\n return format.replace(formatRegExp, function (match, index) {\n var value = values[parseInt(index, 10) + 1];\n\n return value;\n });\n}","import formatString from '../common/format-string';\nimport isString from '../common/is-string';\nimport { EMPTY } from '../common/constants';\n\nvar REMOVAL_PENALTY = 120;\nvar ADDITION_PENALTY = 20;\nvar LENGHT_DELTA = [ 2, 1, 5, 3, 4 ];\nvar LONG_LESS_PENALTY_DELTA = -2;\nvar SHORT_LESS_PENALTY_DELTA = -1;\nvar SHORT_MORE_PENALTY_DELTA = 1;\nvar LONG_MORE_PENALTY_DELTA = 2;\n\nvar PENALTIES = {};\nPENALTIES[LONG_LESS_PENALTY_DELTA.toString()] = 8;\nPENALTIES[SHORT_LESS_PENALTY_DELTA.toString()] = 6;\nPENALTIES[LONG_MORE_PENALTY_DELTA.toString()] = 6;\nPENALTIES[SHORT_MORE_PENALTY_DELTA.toString()] = 3;\n\nvar VALUE_FORMAT_LENGTH = {\n numeric: 1,\n \"2-digit\": 2,\n short: 3,\n long: 4,\n narrow: 5\n};\n\nvar TIME_SPECIFIERS_REGEX = /[hHmsSzZoOvVxX]/;\n\nfunction getHourSpecifier(options) {\n return options.hour12 ? \"h\" : \"H\";\n}\n\nvar DATE_OPTIONS_MAP = [ {\n key: \"era\",\n specifier: \"G\"\n}, {\n key: \"year\",\n specifier: \"y\"\n}, {\n key: \"month\",\n specifier: \"M\"\n}, {\n key: \"day\",\n specifier: \"d\"\n}, {\n key: \"weekday\",\n specifier: \"E\"\n}, {\n key: \"hour\",\n getSpecifier: getHourSpecifier\n}, {\n key: \"minute\",\n specifier: \"m\"\n}, {\n key: \"second\",\n specifier: \"s\"\n}, {\n key: \"timeZoneName\",\n specifier: \"z\"\n} ];\n\nvar STAND_ALONE_SPECIFIERS = {\n e: 'c',\n E: 'c',\n M: 'L',\n Q: 'q'\n};\n\nvar specifiersRegex = {};\nvar resolvedFormats = {};\n\nfunction getSpecifierRegex(specifier) {\n if (!specifiersRegex[specifier]) {\n specifiersRegex[specifier] = new RegExp(specifier + \"+\");\n }\n return specifiersRegex[specifier];\n}\n\nfunction skeletonSpecifiers(skeleton) {\n var result = [];\n var current = skeleton.charAt(0);\n var specifier = current;\n for (var idx = 1; idx < skeleton.length; idx++) {\n var character = skeleton.charAt(idx);\n if (character === specifier) {\n current += character;\n } else {\n result.push(current);\n current = specifier = character;\n }\n }\n\n result.push(current);\n\n return result;\n}\n\nfunction findBestMatch(specifiers, availableFormats) {\n var specifiersLength = specifiers.length;\n var maxScore = -Number.MAX_VALUE;\n var bestMatches, result;\n for (var format in availableFormats) {\n var matches = [];\n var currentFormat = format.replace(\"v\", \"z\");\n var score = 0;\n for (var idx = 0; idx < specifiersLength; idx++) {\n var specifier = specifiers[idx];\n var specifierRegex = getSpecifierRegex(specifier[0]);\n var match = (specifierRegex.exec(currentFormat) || [])[0];\n\n if (!match) {\n score -= REMOVAL_PENALTY;\n } else {\n currentFormat = currentFormat.replace(match, EMPTY);\n if (match.length !== specifier.length) {\n var delta = Math.max(Math.min(LENGHT_DELTA[match.length] - LENGHT_DELTA[specifier.length], 2), -2);\n score -= PENALTIES[delta];\n }\n }\n\n matches.push(match);\n\n if (score < maxScore) {\n break;\n }\n }\n\n if (currentFormat.length) {\n score -= skeletonSpecifiers(currentFormat).length * ADDITION_PENALTY;\n }\n\n if (score > maxScore) {\n maxScore = score;\n bestMatches = matches;\n result = availableFormats[format];\n }\n }\n\n result = result.replace(\"v\", \"z\");\n\n for (var idx$1 = 0; idx$1 < specifiersLength; idx$1++) {\n var bestMatch = bestMatches[idx$1];\n if (bestMatch && bestMatch !== specifiers[idx$1]) {\n var matchSpecifier = bestMatches[idx$1][0];\n result = result.replace(getSpecifierRegex(matchSpecifier), specifiers[idx$1]);\n if (STAND_ALONE_SPECIFIERS[matchSpecifier]) {\n result = result.replace(getSpecifierRegex(STAND_ALONE_SPECIFIERS[matchSpecifier]), specifiers[idx$1]);\n }\n }\n }\n\n return result;\n}\n\nfunction cacheFormat(skeleton, format, locale) {\n if (!resolvedFormats[locale]) {\n resolvedFormats[locale] = {};\n }\n resolvedFormats[locale][skeleton] = format;\n}\n\n\nfunction skeletonFormat(skeleton, info) {\n var availableFormats = info.calendar.dateTimeFormats.availableFormats;\n if (availableFormats[skeleton]) {\n return availableFormats[skeleton];\n }\n if (resolvedFormats[info.name] && resolvedFormats[info.name][skeleton]) {\n return resolvedFormats[info.name][skeleton];\n }\n var timeStartIndex = skeleton.search(TIME_SPECIFIERS_REGEX);\n var result;\n if (timeStartIndex > 0) {\n var dateSkeleton = skeleton.substr(0, timeStartIndex);\n var timeSkeleton = skeleton.substr(timeStartIndex);\n\n result = formatString(info.calendar.dateTimeFormats.short, //should be deterimed based on specifiers\n availableFormats[timeSkeleton] || findBestMatch(skeletonSpecifiers(timeSkeleton), availableFormats),\n availableFormats[dateSkeleton] || findBestMatch(skeletonSpecifiers(dateSkeleton), availableFormats));\n } else {\n result = findBestMatch(skeletonSpecifiers(skeleton), availableFormats);\n }\n\n cacheFormat(skeleton, result, info.name);\n return result;\n}\n\nfunction skeletonFromOptions(options) {\n var result = [];\n for (var idx = 0; idx < DATE_OPTIONS_MAP.length; idx++) {\n var option = DATE_OPTIONS_MAP[idx];\n var field = option.key;\n var value = options[field];\n if (value) {\n var spcifier = option.specifier || option.getSpecifier(options);\n result.push(spcifier.repeat(VALUE_FORMAT_LENGTH[value]));\n }\n }\n\n return result.join(EMPTY);\n}\n\nexport default function datePattern(format, info) {\n var calendar = info.calendar;\n var result;\n if (isString(format)) {\n if (calendar.patterns[format]) {\n result = calendar.patterns[format];\n } else {\n result = format;\n }\n } else if (format) {\n if (format.pattern) {\n return format.pattern;\n }\n\n var skeleton = format.skeleton;\n if (!skeleton) {\n if (format.datetime) {\n result = formatString(calendar.dateTimeFormats[format.datetime], calendar.timeFormats[format.datetime], calendar.dateFormats[format.datetime]);\n } else if (format.date) {\n result = calendar.dateFormats[format.date];\n } else if (format.time) {\n result = calendar.timeFormats[format.time];\n } else {\n skeleton = skeletonFromOptions(format);\n }\n }\n\n if (skeleton) {\n result = skeletonFormat(skeleton, info);\n }\n }\n\n if (!result) {\n result = calendar.patterns.d;\n }\n\n return result;\n}\n","export default function dateNameType(formatLength) {\n var nameType;\n if (formatLength <= 3) {\n nameType = \"abbreviated\";\n } else if (formatLength === 4) {\n nameType = \"wide\";\n } else if (formatLength === 5) {\n nameType = \"narrow\";\n } else if (formatLength === 6) {\n nameType = \"short\";\n }\n\n return nameType;\n}","import dateFormatNames from '../cldr/date-format-names';\nimport dateNameType from './date-name-type';\n\nexport default function formatNames(locale, type, formatLength, standAlone, lower) {\n return dateFormatNames(locale, {\n type: type,\n nameType: dateNameType(formatLength),\n standAlone: standAlone,\n lower: lower\n });\n}","function isFunction(fun) {\n return typeof(fun) === 'function';\n}\n\nexport default function isDate(value) {\n return Boolean(value) && isFunction(value.getTime) && isFunction(value.getMonth);\n}\n","var MONTH = 'month';\nvar HOUR = 'hour';\nvar ZONE = 'zone';\nvar WEEKDAY = 'weekday';\nvar QUARTER = 'quarter';\n\nvar DATE_FIELD_MAP = {\n 'G': 'era',\n 'y': 'year',\n 'q': QUARTER,\n 'Q': QUARTER,\n 'M': MONTH,\n 'L': MONTH,\n 'd': 'day',\n 'E': WEEKDAY,\n 'c': WEEKDAY,\n 'e': WEEKDAY,\n 'h': HOUR,\n 'H': HOUR,\n 'k': HOUR,\n 'K': HOUR,\n 'm': 'minute',\n 's': 'second',\n 'S': 'millisecond',\n 'a': 'dayperiod',\n 'x': ZONE,\n 'X': ZONE,\n 'z': ZONE,\n 'Z': ZONE\n};\n\nvar dateFormatRegExp = /d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|\"[^\"]*\"|'[^']*'/g;\n\nexport { dateFormatRegExp, DATE_FIELD_MAP };","import { localeInfo, firstDay } from '../cldr';\nimport { DEFAULT_LOCALE, EMPTY } from '../common/constants';\nimport formatString from '../common/format-string';\nimport datePattern from './date-pattern';\nimport formatNames from './format-names';\nimport pad from '../common/pad';\nimport isDate from '../common/is-date';\nimport { dateFormatRegExp } from './constants';\n\nfunction formatDayOfWeekIndex(day, formatLength, localeInfo) {\n var firstDayIndex = firstDay(localeInfo);\n var dayIndex;\n if (day < firstDayIndex) {\n dayIndex = 7 - firstDayIndex + day;\n } else {\n dayIndex = day - firstDayIndex;\n }\n\n return dayIndex + 1;\n}\n\nfunction formatMonth(month, formatLength, info, standAlone) {\n if (formatLength <= 2) {\n return pad(month + 1, formatLength);\n }\n return formatNames(info, \"months\", formatLength, standAlone)[month];\n}\n\nfunction formatQuarter(date, formatLength, info, standAlone) {\n var quarter = Math.floor(date.getMonth() / 3);\n if (formatLength < 3) {\n return quarter + 1;\n }\n\n return formatNames(info, \"quarters\", formatLength, standAlone)[quarter];\n}\n\n\nfunction formatTimeZone(date, info, options) {\n var shortHours = options.shortHours;\n var optionalMinutes = options.optionalMinutes;\n var separator = options.separator;\n var localizedName = options.localizedName;\n var zZeroOffset = options.zZeroOffset;\n var offset = date.getTimezoneOffset() / 60;\n if (offset === 0 && zZeroOffset) {\n return \"Z\";\n }\n var sign = offset <= 0 ? \"+\" : \"-\";\n var hoursMinutes = Math.abs(offset).toString().split(\".\");\n var minutes = hoursMinutes[1] || 0;\n var result = sign + (shortHours ? hoursMinutes[0] : pad(hoursMinutes[0], 2));\n if (minutes || !optionalMinutes) {\n result += (separator ? \":\" : EMPTY) + pad(minutes, 2);\n }\n\n if (localizedName) {\n var localizedFormat = offset === 0 ? info.calendar.gmtZeroFormat : info.calendar.gmtFormat;\n result = formatString(localizedFormat, result);\n }\n\n return result;\n}\n\nfunction formatDayOfWeek(date, formatLength, info, standAlone) {\n var result;\n if (formatLength < 3) {\n result = formatDayOfWeekIndex(date.getDay(), formatLength, info);\n } else {\n result = formatNames(info, \"days\", formatLength, standAlone)[date.getDay()];\n }\n return result;\n}\n\nvar formatters = {};\n\nformatters.d = function(date, formatLength) {\n return pad(date.getDate(), formatLength);\n};\n\nformatters.E = function(date, formatLength, info) {\n return formatNames(info, \"days\", formatLength)[date.getDay()];\n};\n\nformatters.M = function(date, formatLength, info) {\n return formatMonth(date.getMonth(), formatLength, info, false);\n};\n\nformatters.L = function(date, formatLength, info) {\n return formatMonth(date.getMonth(), formatLength, info, true);\n};\n\nformatters.y = function(date, formatLength) {\n var year = date.getFullYear();\n if (formatLength === 2) {\n year = year % 100;\n }\n return pad(year, formatLength);\n};\n\nformatters.h = function(date, formatLength) {\n var hours = date.getHours() % 12 || 12;\n return pad(hours, formatLength);\n};\n\nformatters.H = function(date, formatLength) {\n return pad(date.getHours(), formatLength);\n};\n\nformatters.k = function(date, formatLength) {\n return pad(date.getHours() || 24, formatLength);\n};\n\nformatters.K = function(date, formatLength) {\n return pad(date.getHours() % 12, formatLength);\n};\n\nformatters.m = function(date, formatLength) {\n return pad(date.getMinutes(), formatLength);\n};\n\nformatters.s = function(date, formatLength) {\n return pad(date.getSeconds(), formatLength);\n};\n\nformatters.S = function(date, formatLength) {\n var milliseconds = date.getMilliseconds();\n var result;\n if (milliseconds !== 0) {\n result = pad(String(milliseconds / 1000).split(\".\")[1].substr(0, formatLength), formatLength, true);\n } else {\n result = pad(EMPTY, formatLength);\n }\n return result;\n};\n\nformatters.a = function(date, formatLength, info) {\n return formatNames(info, \"dayPeriods\", formatLength)[date.getHours() < 12 ? \"am\" : \"pm\"];\n};\n\nformatters.z = function(date, formatLength, info) {\n return formatTimeZone(date, info, {\n shortHours: formatLength < 4,\n optionalMinutes: formatLength < 4,\n separator: true,\n localizedName: true\n });\n};\n\nformatters.Z = function(date, formatLength, info) {\n return formatTimeZone(date, info, {\n separator: formatLength > 3,\n localizedName: formatLength === 4,\n zZeroOffset: formatLength === 5\n });\n};\n\nformatters.x = function(date, formatLength, info) {\n return formatTimeZone(date, info, {\n optionalMinutes: formatLength === 1,\n separator: formatLength === 3 || formatLength === 5\n });\n};\n\nformatters.X = function(date, formatLength, info) {\n return formatTimeZone(date, info, {\n optionalMinutes: formatLength === 1,\n separator: formatLength === 3 || formatLength === 5,\n zZeroOffset: true\n });\n};\n\nformatters.G = function(date, formatLength, info) {\n var era = date.getFullYear() >= 0 ? 1 : 0;\n return formatNames(info, \"eras\", formatLength)[era];\n};\n\nformatters.e = formatDayOfWeek;\n\nformatters.c = function(date, formatLength, info) {\n return formatDayOfWeek(date, formatLength, info, true);\n};\n\nformatters.q = function(date, formatLength, info) {\n return formatQuarter(date, formatLength, info, true);\n};\n\nformatters.Q = formatQuarter;\n\nexport default function formatDate(date, format, locale) {\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n\n if (!isDate(date)) {\n if (date === undefined || date === null) {\n return EMPTY;\n }\n return date;\n }\n\n var info = localeInfo(locale);\n var pattern = datePattern(format, info);\n\n return pattern.replace(dateFormatRegExp, function(match) {\n var formatLength = match.length;\n var result;\n\n if (match.includes(\"'\") || match.includes(\"\\\"\")) {\n result = match.slice(1, formatLength - 1);\n } else {\n result = formatters[match[0]](date, formatLength, info);\n }\n\n return result;\n });\n}\n","export function convertTimeZone(date, fromOffset, toOffset) {\n var fromLocalOffset = date.getTimezoneOffset();\n\n var offsetDate = new Date(date.getTime() + (fromOffset - toOffset) * 60000);\n\n var toLocalOffset = offsetDate.getTimezoneOffset();\n\n return new Date(offsetDate.getTime() + (toLocalOffset - fromLocalOffset) * 60000);\n}\n\nexport function adjustDST(date, hours) {\n if (!hours && date.getHours() === 23) {\n date.setHours(date.getHours() + 2);\n }\n}","import { adjustDST, convertTimeZone } from './time-utils';\nimport { localeInfo } from '../cldr';\nimport { DEFAULT_LOCALE, EMPTY } from '../common/constants';\nimport { errors } from '../errors';\nimport formatNames from './format-names';\nimport datePattern from './date-pattern';\nimport round from '../common/round';\nimport isDate from '../common/is-date';\n\nvar timeZoneOffsetRegExp = /([+|-]\\d{1,2})(:?)(\\d{2})?/;\nvar dateRegExp = /^\\/Date\\((.*?)\\)\\/$/;\nvar offsetRegExp = /[+-]\\d*/;\nvar numberRegExp = {\n 2: /^\\d{1,2}/,\n 3: /^\\d{1,3}/,\n 4: /^\\d{4}/\n};\nvar numberRegex = /\\d+/;\nvar PLACEHOLDER = \"{0}\";\n\nvar leadingSpacesRegex = /^ */;\nvar trailingSpacesRegex = / *$/;\n\nvar standardDateFormats = [\n \"yyyy/MM/dd HH:mm:ss\",\n \"yyyy/MM/dd HH:mm\",\n \"yyyy/MM/dd\",\n \"E MMM dd yyyy HH:mm:ss\",\n \"yyyy-MM-ddTHH:mm:ss.SSSSSSSXXX\",\n \"yyyy-MM-ddTHH:mm:ss.SSSXXX\",\n \"yyyy-MM-ddTHH:mm:ss.SSXXX\",\n \"yyyy-MM-ddTHH:mm:ssXXX\",\n \"yyyy-MM-ddTHH:mm:ss.SSSSSSS\",\n \"yyyy-MM-ddTHH:mm:ss.SSS\",\n \"yyyy-MM-ddTHH:mmXXX\",\n \"yyyy-MM-ddTHH:mmX\",\n \"yyyy-MM-ddTHH:mm:ss\",\n \"yyyy-MM-ddTHH:mm\",\n \"yyyy-MM-dd HH:mm:ss\",\n \"yyyy-MM-dd HH:mm\",\n \"yyyy-MM-dd\",\n \"HH:mm:ss\",\n \"HH:mm\"\n];\nvar FORMATS_SEQUENCE = [ \"G\", \"g\", \"F\", \"Y\", \"y\", \"M\", \"m\", \"D\", \"d\", \"y\", \"T\", \"t\" ];\nvar TWO_DIGIT_YEAR_MAX = 2029;\n\nfunction outOfRange(value, start, end) {\n return !(value >= start && value <= end);\n}\n\nfunction lookAhead(match, state) {\n var format = state.format;\n var idx = state.idx;\n var i = 0;\n while (format[idx] === match) {\n i++;\n idx++;\n }\n if (i > 0) {\n idx -= 1;\n }\n state.idx = idx;\n return i;\n}\n\nfunction getNumber(size, state) {\n var regex = size ? (numberRegExp[size] || new RegExp('^\\\\d{1,' + size + '}')) : numberRegex,\n match = state.value.substr(state.valueIdx, size).match(regex);\n\n if (match) {\n match = match[0];\n state.valueIdx += match.length;\n return parseInt(match, 10);\n }\n return null;\n}\n\nfunction getIndexByName(names, state, lower) {\n var i = 0,\n length = names.length,\n name, nameLength,\n matchLength = 0,\n matchIdx = 0,\n subValue;\n\n for (; i < length; i++) {\n name = names[i];\n nameLength = name.length;\n subValue = state.value.substr(state.valueIdx, nameLength);\n\n if (lower) {\n subValue = subValue.toLowerCase();\n }\n\n if (subValue === name && nameLength > matchLength) {\n matchLength = nameLength;\n matchIdx = i;\n }\n }\n\n if (matchLength) {\n state.valueIdx += matchLength;\n return matchIdx + 1;\n }\n\n return null;\n}\n\nfunction checkLiteral(state) {\n var result = false;\n if (state.value.charAt(state.valueIdx) === state.format[state.idx]) {\n state.valueIdx++;\n result = true;\n }\n return result;\n}\n\nfunction calendarGmtFormats(calendar) {\n var gmtFormat = calendar.gmtFormat;\n var gmtZeroFormat = calendar.gmtZeroFormat;\n if (!gmtFormat) {\n throw errors.NoGMTInfo.error();\n }\n\n return [ gmtFormat.replace(PLACEHOLDER, EMPTY).toLowerCase(), gmtZeroFormat.replace(PLACEHOLDER, EMPTY).toLowerCase() ];\n}\n\nfunction parseTimeZoneOffset(state, info, options) {\n var shortHours = options.shortHours;\n var noSeparator = options.noSeparator;\n var optionalMinutes = options.optionalMinutes;\n var localizedName = options.localizedName;\n var zLiteral = options.zLiteral;\n state.UTC = true;\n\n if (zLiteral && state.value.charAt(state.valueIdx) === \"Z\") {\n state.valueIdx++;\n return false;\n }\n\n if (localizedName && !getIndexByName(calendarGmtFormats(info.calendar), state, true)) {\n return true;\n }\n\n var matches = timeZoneOffsetRegExp.exec(state.value.substr(state.valueIdx, 6));\n if (!matches) {\n return !localizedName;\n }\n\n var hoursMatch = matches[1];\n var minutesMatch = matches[3];\n var hoursOffset = parseInt(hoursMatch, 10);\n var separator = matches[2];\n var minutesOffset = parseInt(minutesMatch, 10);\n\n if (isNaN(hoursOffset) || (!shortHours && hoursMatch.length !== 3) || (!optionalMinutes && isNaN(minutesOffset)) || (noSeparator && separator)) {\n return true;\n }\n\n if (isNaN(minutesOffset)) {\n minutesOffset = null;\n }\n\n if (outOfRange(hoursOffset, -12, 13) || (minutesOffset && outOfRange(minutesOffset, 0, 59))) {\n return true;\n }\n\n state.valueIdx += matches[0].length;\n state.hoursOffset = hoursOffset;\n state.minutesOffset = minutesOffset;\n}\n\nfunction parseMonth(ch, state, info) {\n var count = lookAhead(ch, state);\n var names = formatNames(info, \"months\", count, ch === \"L\", true);\n\n var month = count < 3 ? getNumber(2, state) : getIndexByName(names, state, true);\n\n if (month === null || outOfRange(month, 1, 12)) {\n return true;\n }\n state.month = month - 1;\n}\n\nfunction parseDayOfWeek(ch, state, info) {\n var count = lookAhead(ch, state);\n var names = formatNames(info, \"days\", count, ch === \"c\", true);\n var dayOfWeek = count < 3 ? getNumber(1, state) : getIndexByName(names, state, true);\n if ((!dayOfWeek && dayOfWeek !== 0) || outOfRange(dayOfWeek, 1, 7)) {\n return true;\n }\n}\n\nvar parsers = {};\n\nparsers.d = function(state) {\n lookAhead(\"d\", state);\n var day = getNumber(2, state);\n\n if (day === null || outOfRange(day, 1, 31)) {\n return true;\n }\n\n if (state.day === null) {\n state.day = day;\n }\n};\n\nparsers.E = function(state, info) {\n var count = lookAhead(\"E\", state);\n //validate if it matches the day?\n var dayOfWeek = getIndexByName(formatNames(info, \"days\", count, false, true), state, true);\n if (dayOfWeek === null) {\n return true;\n }\n};\n\nparsers.M = function(state, info) {\n return parseMonth(\"M\", state, info);\n};\n\nparsers.L = function(state, info) {\n return parseMonth(\"L\", state, info);\n};\n\nparsers.y = function(state) {\n var count = lookAhead(\"y\", state);\n var year = getNumber(count === 1 ? undefined : count, state);\n\n if (year === null) {\n return true;\n }\n\n if (count === 2) {\n var currentYear = new Date().getFullYear();\n year = (currentYear - currentYear % 100) + year;\n if (year > TWO_DIGIT_YEAR_MAX) {\n year -= 100;\n }\n }\n\n state.year = year;\n};\n\nparsers.h = function(state) {\n lookAhead(\"h\", state);\n\n var hours = getNumber(2, state);\n if (hours === 12) {\n hours = 0;\n }\n\n if (hours === null || outOfRange(hours, 0, 11)) {\n return true;\n }\n\n state.hours = hours;\n};\n\nparsers.K = function(state) {\n lookAhead(\"K\", state);\n\n var hours = getNumber(2, state);\n\n if (hours === null || outOfRange(hours, 0, 11)) {\n return true;\n }\n\n state.hours = hours;\n};\n\nparsers.a = function(state, info) {\n var count = lookAhead(\"a\", state);\n var periodFormats = formatNames(info, \"dayPeriods\", count, false, true);\n\n var pmHour = getIndexByName([ periodFormats.pm ], state, true);\n if (!pmHour && !getIndexByName([ periodFormats.am ], state, true)) {\n return true;\n }\n\n state.pmHour = pmHour;\n};\n\nparsers.H = function(state) {\n lookAhead(\"H\", state);\n var hours = getNumber(2, state);\n if (hours === null || outOfRange(hours, 0, 23)) {\n return true;\n }\n state.hours = hours;\n};\n\nparsers.k = function(state) {\n lookAhead(\"k\", state);\n\n var hours = getNumber(2, state);\n\n if (hours === null || outOfRange(hours, 1, 24)) {\n return true;\n }\n\n state.hours = hours === 24 ? 0 : hours;\n};\n\nparsers.m = function(state) {\n lookAhead(\"m\", state);\n var minutes = getNumber(2, state);\n\n if (minutes === null || outOfRange(minutes, 0, 59)) {\n return true;\n }\n\n state.minutes = minutes;\n};\n\nparsers.s = function(state) {\n lookAhead(\"s\", state);\n var seconds = getNumber(2, state);\n if (seconds === null || outOfRange(seconds, 0, 59)) {\n return true;\n }\n state.seconds = seconds;\n};\n\nparsers.S = function(state) {\n var count = lookAhead(\"S\", state);\n var match = state.value.substr(state.valueIdx, count);\n var milliseconds = null;\n\n if (!isNaN(parseInt(match, 10))) {\n milliseconds = parseFloat(\"0.\" + match, 10);\n milliseconds = round(milliseconds, 3);\n milliseconds *= 1000;\n state.valueIdx += count;\n }\n\n if (milliseconds === null || outOfRange(milliseconds, 0, 999)) {\n return true;\n }\n\n state.milliseconds = milliseconds;\n};\n\nparsers.z = function(state, info) {\n var count = lookAhead(\"z\", state);\n\n var shortFormat = count < 4;\n\n var invalid = parseTimeZoneOffset(state, info, {\n shortHours: shortFormat,\n optionalMinutes: shortFormat,\n localizedName: true\n });\n\n if (invalid) {\n return invalid;\n }\n};\n\nparsers.Z = function(state, info) {\n var count = lookAhead(\"Z\", state);\n\n var invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count < 4,\n zLiteral: count === 5,\n localizedName: count === 4\n });\n\n if (invalid) {\n return invalid;\n }\n};\n\nparsers.x = function(state, info) {\n var count = lookAhead(\"x\", state);\n\n var invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count !== 3 && count !== 5,\n optionalMinutes: count === 1\n });\n if (invalid) {\n return invalid;\n }\n};\n\nparsers.X = function(state, info) {\n var count = lookAhead(\"X\", state);\n\n var invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count !== 3 && count !== 5,\n optionalMinutes: count === 1,\n zLiteral: true\n });\n if (invalid) {\n return invalid;\n }\n};\n\nparsers.G = function(state, info) {\n var count = lookAhead(\"G\", state);\n var eras = formatNames(info, \"eras\", count, false, true);\n var era = getIndexByName([ eras[0], eras[1] ], state, true);\n\n if (era === null) {\n return true;\n }\n};\n\nparsers.e = function(state, info) {\n return parseDayOfWeek(\"e\", state, info);\n};\n\nparsers.c = function(state, info) {\n return parseDayOfWeek(\"c\", state, info);\n};\n\nfunction createDate(state) {\n var year = state.year;\n var month = state.month;\n var day = state.day;\n var hours = state.hours;\n var minutes = state.minutes;\n var seconds = state.seconds;\n var milliseconds = state.milliseconds;\n var pmHour = state.pmHour;\n var UTC = state.UTC;\n var hoursOffset = state.hoursOffset;\n var minutesOffset = state.minutesOffset;\n var hasTime = hours !== null || minutes !== null || seconds || null;\n var date = new Date();\n var result;\n\n if (year === null && month === null && day === null && hasTime) {\n year = date.getFullYear();\n month = date.getMonth();\n day = date.getDate();\n } else {\n if (year === null) {\n year = date.getFullYear();\n }\n\n if (day === null) {\n day = 1;\n }\n }\n\n if (pmHour && hours < 12) {\n hours += 12;\n }\n\n if (UTC) {\n if (hoursOffset) {\n hours += -hoursOffset;\n }\n\n if (minutesOffset) {\n minutes += -minutesOffset * (hoursOffset < 0 ? -1 : 1);\n }\n\n result = new Date(Date.UTC(year, month, day, hours, minutes, seconds, milliseconds));\n } else {\n result = new Date(year, month, day, hours, minutes, seconds, milliseconds);\n adjustDST(result, hours);\n }\n\n if (year < 100) {\n result.setFullYear(year);\n }\n\n if (result.getDate() !== day && UTC === undefined) {\n return null;\n }\n\n return result;\n}\n\nfunction addFormatSpaces(value, format) {\n var leadingSpaces = leadingSpacesRegex.exec(format)[0];\n var trailingSpaces = trailingSpacesRegex.exec(format)[0];\n\n return (\"\" + leadingSpaces + value + trailingSpaces);\n}\n\nfunction parseExact(value, format, info) {\n var pattern = datePattern(format, info).split(EMPTY);\n\n var state = {\n format: pattern,\n idx: 0,\n value: addFormatSpaces(value, format),\n valueIdx: 0,\n year: null,\n month: null,\n day: null,\n hours: null,\n minutes: null,\n seconds: null,\n milliseconds: null\n };\n var length = pattern.length;\n var literal = false;\n\n for (; state.idx < length; state.idx++) {\n var ch = pattern[state.idx];\n\n if (literal) {\n if (ch === \"'\") {\n literal = false;\n }\n\n checkLiteral(state);\n } else {\n if (parsers[ch]) {\n var invalid = parsers[ch](state, info);\n if (invalid) {\n return null;\n }\n } else if (ch === \"'\") {\n literal = true;\n checkLiteral(state);\n } else if (!checkLiteral(state)) {\n return null;\n }\n }\n }\n\n if (state.valueIdx < value.length) {\n return null;\n }\n\n return createDate(state) || null;\n}\n\nfunction parseMicrosoftDateOffset(offset) {\n var sign = offset.substr(0, 1) === \"-\" ? -1 : 1;\n\n var result = offset.substring(1);\n result = (parseInt(result.substr(0, 2), 10) * 60) + parseInt(result.substring(2), 10);\n\n return sign * result;\n}\n\nfunction parseMicrosoftDateFormat(value) {\n if (value && value.indexOf(\"/D\") === 0) {\n var date = dateRegExp.exec(value);\n if (date) {\n date = date[1];\n var tzoffset = offsetRegExp.exec(date.substring(1));\n\n date = new Date(parseInt(date, 10));\n\n if (tzoffset) {\n tzoffset = parseMicrosoftDateOffset(tzoffset[0]);\n date = convertTimeZone(date, date.getTimezoneOffset(), 0);\n date = convertTimeZone(date, 0, -1 * tzoffset);\n }\n\n return date;\n }\n }\n}\n\nfunction defaultFormats(calendar) {\n var formats = [];\n var patterns = calendar.patterns;\n var length = FORMATS_SEQUENCE.length;\n\n for (var idx = 0; idx < length; idx++) {\n formats.push(patterns[FORMATS_SEQUENCE[idx]]);\n }\n\n return formats.concat(standardDateFormats);\n}\n\nexport default function parseDate(value, formats, locale) {\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n\n if (!value) {\n return null;\n }\n\n if (isDate(value)) {\n return value;\n }\n\n var parseValue = String(value).trim();\n var date = parseMicrosoftDateFormat(parseValue);\n if (date) {\n return date;\n }\n\n var info = localeInfo(locale);\n var parseFormats = formats || defaultFormats(info.calendar);\n parseFormats = Array.isArray(parseFormats) ? parseFormats : [ parseFormats ];\n\n var length = parseFormats.length;\n\n for (var idx = 0; idx < length; idx++) {\n date = parseExact(parseValue, parseFormats[idx], info);\n if (date) {\n return date;\n }\n }\n\n return date;\n}\n","import { DEFAULT_LOCALE } from '../common/constants';\nimport isNumber from '../common/is-number';\nimport datePattern from './date-pattern';\nimport dateNameType from './date-name-type';\nimport { dateFormatRegExp, DATE_FIELD_MAP } from './constants';\nimport { localeInfo } from '../cldr';\n\nvar NAME_TYPES = {\n month: {\n type: 'months',\n minLength: 3,\n standAlone: 'L'\n },\n\n quarter: {\n type: 'quarters',\n minLength: 3,\n standAlone: 'q'\n },\n\n weekday: {\n type: 'days',\n minLength: {\n E: 0,\n c: 3,\n e: 3\n },\n standAlone: 'c'\n },\n\n dayperiod: {\n type: 'dayPeriods',\n minLength: 0\n },\n\n era: {\n type: 'eras',\n minLength: 0\n }\n};\n\nvar LITERAL = 'literal';\n\nfunction addLiteral(parts, value) {\n var lastPart = parts[parts.length - 1];\n if (lastPart && lastPart.type === LITERAL) {\n lastPart.pattern += value;\n } else {\n parts.push({\n type: LITERAL,\n pattern: value\n });\n }\n}\n\nfunction isHour12(pattern) {\n return pattern === 'h' || pattern === 'K';\n}\n\nexport default function splitDateFormat(format, locale) {\n if ( locale === void 0 ) locale = DEFAULT_LOCALE;\n\n var info = localeInfo(locale);\n var pattern = datePattern(format, info);\n var parts = [];\n var lastIndex = dateFormatRegExp.lastIndex = 0;\n var match = dateFormatRegExp.exec(pattern);\n\n while (match) {\n var value = match[0];\n\n if (lastIndex < match.index) {\n addLiteral(parts, pattern.substring(lastIndex, match.index));\n }\n\n if (value.startsWith('\"') || value.startsWith(\"'\")) {\n addLiteral(parts, value);\n } else {\n var specifier = value[0];\n var type = DATE_FIELD_MAP[specifier];\n var part = {\n type: type,\n pattern: value\n };\n\n if (type === 'hour') {\n part.hour12 = isHour12(value);\n }\n\n var names = NAME_TYPES[type];\n\n if (names) {\n var minLength = isNumber(names.minLength) ? names.minLength : names.minLength[specifier];\n var patternLength = value.length;\n\n if (patternLength >= minLength) {\n part.names = {\n type: names.type,\n nameType: dateNameType(patternLength),\n standAlone: names.standAlone === specifier\n };\n }\n }\n\n parts.push(part);\n }\n\n lastIndex = dateFormatRegExp.lastIndex;\n match = dateFormatRegExp.exec(pattern);\n }\n\n if (lastIndex < pattern.length) {\n addLiteral(parts, pattern.substring(lastIndex));\n }\n\n return parts;\n}\n","import { formatDate } from './dates';\nimport { formatNumber } from './numbers';\nimport { EMPTY } from './common/constants';\nimport isDate from './common/is-date';\nimport isNumber from './common/is-number';\n\nvar formatRegExp = /\\{(\\d+)(:[^}]+)?\\}/g;\n\nexport function toString(value, format, locale) {\n if (format) {\n if (isDate(value)) {\n return formatDate(value, format, locale);\n } else if (isNumber(value)) {\n return formatNumber(value, format, locale);\n }\n }\n\n return value !== undefined && value !== null ? value : EMPTY;\n}\n\nexport function format(format, values, locale) {\n return format.replace(formatRegExp, function(match, index, placeholderFormat) {\n var value = values[parseInt(index, 10)];\n\n return toString(value, placeholderFormat ? placeholderFormat.substring(1) : EMPTY, locale);\n });\n}\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-intl',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695800898,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","import * as coreIntl from '@progress/kendo-intl';\nimport * as licensing from '@progress/kendo-licensing';\nimport { packageMetadata } from '../package-metadata';\n/* eslint-disable max-len */\n/**\n * A service which provides internationalization methods and is bound to a specific locale.\n */\nvar IntlService = /** @class */ (function () {\n /**\n * Creates a new instance of the internationalization service.\n *\n * @param locale - The locale that will be used by the internationalization methods.\n */\n function IntlService(locale) {\n this.locale = locale;\n if (typeof licensing !== 'undefined') {\n licensing.validatePackage(packageMetadata);\n }\n else {\n var message = \"License activation failed for \".concat(packageMetadata.name, \"\\n\");\n message += 'The @progress/kendo-licensing script is not loaded.\\n';\n message += \"See \".concat(packageMetadata.licensingDocsUrl, \" for more information.\\n\");\n console.warn(message);\n }\n if (locale === '' && process.env.NODE_ENV !== 'production') {\n throw 'Locale should not be empty string';\n }\n }\n /**\n * Formats a string with placeholders such as `Total amount {0:c}`.\n *\n * @param format - The format string.\n * @param values - One or more values to output in the format string placeholders.\n * @return - The formatted string.\n */\n IntlService.prototype.format = function (format) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n /* The following code retains backward compatibility with the old API */\n if (values.length === 1 && Array.isArray(values[0])) {\n return coreIntl.format(format, values[0], this.locale);\n }\n return coreIntl.format(format, values, this.locale);\n };\n /**\n * Converts a `Date` object to a string based on the specified format. If no format is provided, the default short date format is used.\n *\n * @param value - The date which will be formatted.\n * @param format - The format string or options.\n * @return - The formatted date.\n */\n IntlService.prototype.formatDate = function (value, format) {\n return coreIntl.formatDate(value, format, this.locale);\n };\n /**\n * Converts an object to a string based on the specified format.\n *\n * @param value - The value which will be formatted.\n * @param format - The format to use.\n * @return - The formatted object.\n */\n IntlService.prototype.toString = function (value, format) {\n return coreIntl.toString(value, format, this.locale);\n };\n /**\n * Converts a string to a `Number`.\n *\n * @param value - The string which will be parsed.\n * @param format - The format string or options.\n * @return - The parsed number.\n */\n IntlService.prototype.parseNumber = function (value, format) {\n return coreIntl.parseNumber(value, this.locale, format);\n };\n /**\n * Converts a string to a `Date` object based on the specified format.\n *\n * @param value - The string which will be converted.\n * @param format - The format strings or options.\n * @return - The parsed date.\n */\n IntlService.prototype.parseDate = function (value, format) {\n return coreIntl.parseDate(value, format, this.locale);\n };\n /**\n * Converts a `Number` to a string based on the specified format.\n *\n * @param value - The number which will be formatted.\n * @param format - The format string or options.\n * @return - The formatted number.\n */\n IntlService.prototype.formatNumber = function (value, format) {\n return coreIntl.formatNumber(value, format, this.locale);\n };\n /**\n * Returns a localized date field name based on specific `dateFieldName` options.\n *\n * @param options - The detailed configuration for the desired date field name.\n * @returns - The localized date field name from the current locale based on the option.\n */\n IntlService.prototype.dateFieldName = function (options) {\n return coreIntl.dateFieldName(options, this.locale);\n };\n /**\n * Returns the day names from the current locale based on the option.\n *\n * @param options - The detailed configuration for the desired date format.\n * @return - The day names from the current locale based on the option.\n */\n IntlService.prototype.dateFormatNames = function (options) {\n return coreIntl.dateFormatNames(this.locale, options);\n };\n /**\n * Splits the date format into objects which contain information about each part of the pattern.\n *\n * @param format - The format string or options.\n * @returns - The date format parts.\n */\n IntlService.prototype.splitDateFormat = function (format) {\n return coreIntl.splitDateFormat(format, this.locale);\n };\n /**\n * Returns the number symbols from the current locale.\n *\n * @return - The number symbols from the current locale.\n */\n IntlService.prototype.numberSymbols = function () {\n return coreIntl.numberSymbols(this.locale);\n };\n /**\n * Returns the first day index, starting from Sunday.\n *\n * @return - The index of the first day of the week (0 == Sunday).\n */\n IntlService.prototype.firstDay = function () {\n return coreIntl.firstDay(this.locale);\n };\n /**\n * @hidden\n */\n IntlService.prototype.localeInfo = function () {\n return coreIntl.localeInfo(this.locale);\n };\n return IntlService;\n}());\nexport { IntlService };\n// tslint:enable:max-line-length\n","/**\n * @hidden\n */\nexport var messages = Object.create({});\n","import { messages } from './messages';\n/**\n * A service which provides localization methods.\n */\nvar LocalizationService = /** @class */ (function () {\n function LocalizationService(language) {\n this.language = language;\n if (language === '' && process.env.NODE_ENV !== 'production') {\n throw 'Language should not be an empty string';\n }\n }\n /* eslint-disable max-len */\n /**\n * Provides a string based on a key for the current language. When no string for the current language is available under this key, the `defaultValue` is returned.\n *\n * @param key - The key which identifies the string for the current language.\n * @param defaultValue - The default value which will be returned when no string\n * for the current language is available under the key.\n * @return - The string for the current language.\n */\n // tslint:enable:max-line-length\n LocalizationService.prototype.toLanguageString = function (key, defaultValue) {\n if (this.language &&\n messages[this.language] &&\n messages[this.language].hasOwnProperty(key)) {\n return messages[this.language][key];\n }\n else {\n return defaultValue;\n }\n };\n return LocalizationService;\n}());\nexport { LocalizationService };\n","import * as React from 'react';\nimport { IntlService } from '../Intl/IntlService';\nimport { LocalizationService } from '../Localization/LocalizationService';\n/** @hidden */\nexport var GlobalizationContext = React.createContext({\n intl: new IntlService('en'),\n localization: new LocalizationService()\n});\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { IntlService } from './IntlService';\nimport { GlobalizationContext } from '../globalization/GlobalizationContext';\n/* eslint-disable max-len */\n/**\n * A React component which provides an internationalization service. Expects a locale string as a property of the component.\n */\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Returns an internationalization service. The method is suitable for overriding when you implement custom internationalization behavior.\n */\n IntlProvider.prototype.getIntlService = function () {\n return new IntlService(this.props.locale);\n };\n /**\n * @hidden\n */\n IntlProvider.prototype.render = function () {\n var _this = this;\n return (React.createElement(GlobalizationContext.Consumer, null, function (glob) { return (React.createElement(GlobalizationContext.Provider, { value: __assign(__assign({}, glob), { intl: _this.getIntlService() }) }, _this.props.children)); }));\n };\n /**\n * @hidden\n */\n IntlProvider.propTypes = {\n locale: PropTypes.string\n };\n return IntlProvider;\n}(React.Component));\nexport { IntlProvider };\n// tslint:enable:max-line-length\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { messages as msg } from './messages';\nvar traverse = function (iterable, langInfo, acc) {\n for (var key in iterable) {\n if (iterable.hasOwnProperty(key)) {\n var accumulator = __spreadArray([], acc, true);\n accumulator.push(key);\n if (typeof iterable[key] !== 'string') {\n traverse(iterable[key], langInfo, accumulator);\n }\n else {\n var value = iterable[key];\n Object.defineProperty(langInfo, accumulator.join('.'), { value: value });\n }\n }\n }\n};\n/**\n * Provides mechanism to load language-specific messages for the KendoReact components.\n *\n * @param messages - An iterable object which contains key-value pairs.\n * @param languages - The language to which the messages are associated.\n */\nexport function loadMessages(messages, language) {\n var langInfo = msg[language] = msg[language] || {};\n traverse(messages, langInfo, []);\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { LocalizationService } from './LocalizationService';\nimport { GlobalizationContext } from '../globalization/GlobalizationContext';\n/* eslint-disable max-len */\n/**\n * A React component which provides a localization service. Expects a language string as a property of the component.\n */\nvar LocalizationProvider = /** @class */ (function (_super) {\n __extends(LocalizationProvider, _super);\n function LocalizationProvider() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.\n */\n LocalizationProvider.prototype.getLocalizationService = function () {\n return new LocalizationService(this.props.language);\n };\n /**\n * @hidden\n */\n LocalizationProvider.prototype.render = function () {\n var _this = this;\n return (React.createElement(GlobalizationContext.Consumer, null, function (glob) { return (React.createElement(GlobalizationContext.Provider, { value: __assign(__assign({}, glob), { localization: _this.getLocalizationService() }) }, _this.props.children)); }));\n };\n /**\n * @hidden\n */\n LocalizationProvider.propTypes = {\n language: PropTypes.string\n };\n return LocalizationProvider;\n}(React.Component));\nexport { LocalizationProvider };\n// tslint:enable:max-line-length\n","import { IntlService } from './Intl/IntlService';\nimport { LocalizationService } from './Localization/LocalizationService';\nimport { GlobalizationContext } from './globalization/GlobalizationContext';\n/* eslint-disable max-len */\n/**\n * Provides an internationalization service. When the passed component is a direct or indirect child of `IntlProvider`, the returned service uses the locale of the provider. Otherwise, uses `en` as a default locale. To handle locale changes, call the method on each `render`.\n *\n * @param componentClass - The React component class that will use the internationalization service.\n */\nexport function provideIntlService(component) {\n if (!component && process.env.NODE_ENV !== 'production') {\n throw \"Passed component - \".concat(component, \" is invalid.\");\n }\n var context = component.context;\n return context && context.intl\n ? context.intl\n : new IntlService('en');\n}\n/**\n * Provides a localization service. When the passed component is a direct or indirect child of `LocalizationProvider`, the returned service uses the language of the provider. To handle locale changes, call the method on each `render`.\n *\n * @param componentClass - The React component class that will use the internationalization service.\n */\nexport function provideLocalizationService(component) {\n if (!component && process.env.NODE_ENV !== 'production') {\n throw \"Passed component - \".concat(component, \" is invalid.\");\n }\n var context = component.context;\n return context && context.localization\n ? context.localization\n : new LocalizationService();\n}\n/**\n * A method which registers a component class or a functional stateless component for internationalization. When a component of that type is a direct or indirect child of `IntlProvider`, the locale of the provider is used. Otherwise, uses `en` as a default locale.\n *\n * @param component - The React component class that will use the internationalization methods.\n */\nexport function registerForIntl(component) {\n component.contextType = GlobalizationContext;\n}\n/**\n * A method which registers a component class or a stateless functional component for localization. When a component of that type is a direct or indirect child of `LocalizationProvider`, the language of the provider is used.\n *\n * @param component - The React component class that will use the internationalization methods.\n */\nexport function registerForLocalization(component) {\n component.contextType = GlobalizationContext;\n}\n// tslint:enable:max-line-length\n","import * as React from 'react';\nimport { GlobalizationContext } from '../globalization/GlobalizationContext';\n/**\n * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [IntlService]({% slug api_intl_intlservice %}).\n */\nexport var useInternationalization = function () { return React.useContext(GlobalizationContext).intl; };\n","import * as React from 'react';\nimport { GlobalizationContext } from '../globalization/GlobalizationContext';\n/**\n * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [LocalizationService]({% slug api_intl_localizationservice %}).\n */\nexport var useLocalization = function () { return React.useContext(GlobalizationContext).localization; };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { classNames, kendoThemeMaps } from '@progress/kendo-react-common';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { messages, pagerMobileSelect, pagerPage, pagerMoreButtonLabel } from '../messages';\nimport { provideLocalizationService } from '@progress/kendo-react-intl';\nvar dots = '...';\n/**\n * @hidden\n */\nvar PagerNumericButtons = /** @class */ (function (_super) {\n __extends(PagerNumericButtons, _super);\n function PagerNumericButtons() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handlePageChange = function (e, page) {\n e.preventDefault();\n _this.props.pageChange(page, e);\n };\n _this.handleSelectPageChange = function (e) {\n e.preventDefault();\n _this.props.pageChange(e.target.value, e);\n };\n return _this;\n }\n PagerNumericButtons.prototype.render = function () {\n var _a;\n var _this = this;\n var localizationService = provideLocalizationService(this);\n var mobileSelectMessage = this.props.messagesMap ? this.props.messagesMap(pagerMobileSelect) :\n ({ messageKey: pagerMobileSelect, defaultMessage: messages[pagerMobileSelect] });\n var pageNumberLabelMessage = this.props.messagesMap ? this.props.messagesMap(pagerPage) :\n ({ messageKey: pagerPage, defaultMessage: messages[pagerPage] });\n var pagerMorePagesLabelMessage = this.props.messagesMap ? this.props.messagesMap(pagerMoreButtonLabel) :\n ({ messageKey: pagerMoreButtonLabel, defaultMessage: messages[pagerMoreButtonLabel] });\n var pagerMoreButtonAriaLabel = localizationService.toLanguageString(pagerMorePagesLabelMessage.messageKey, pagerMorePagesLabelMessage.defaultMessage);\n var prevDots = this.start > 1 && this.renderDots(this.start - 1, pagerMoreButtonAriaLabel);\n var postDots = this.end < this.props.totalPages && this.renderDots(this.end + 1, pagerMoreButtonAriaLabel);\n var prevOptionDots = this.start > 1 && this.renderOptionDots(this.start - 1);\n var postOptionDots = this.end < this.props.totalPages && this.renderOptionDots(this.end + 1);\n var buttons = [];\n for (var idx = this.start; idx <= this.end; idx++) {\n buttons.push(idx);\n }\n var numerics = buttons.map(function (page) { return (React.createElement(Button, { className: classNames({ 'k-selected': _this.props.currentPage === page }), key: page, fillMode: 'flat', themeColor: 'primary', size: _this.props.size, rounded: null, role: \"button\", \"aria-label\": localizationService.toLanguageString(pageNumberLabelMessage.messageKey, pageNumberLabelMessage.defaultMessage) + ' ' + page, \"aria-current\": _this.props.currentPage === page ? true : undefined, onClick: function (e) { return _this.handlePageChange(e, page); } }, page)); });\n var options = buttons.map(function (page) { return (React.createElement(\"option\", { key: page }, page)); });\n return (React.createElement(React.Fragment, null,\n React.createElement(\"select\", { style: { width: '5em', margin: '0px 1em', display: this.props.type === 'dropdown'\n ? 'inline-flex'\n : 'none' }, className: classNames('k-picker k-dropdown-list k-dropdown k-rounded-md', (_a = {},\n _a[\"k-picker-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _a)), \"aria-label\": localizationService.toLanguageString(mobileSelectMessage.messageKey, mobileSelectMessage.defaultMessage), value: this.props.currentPage, onChange: function (e) { return _this.handleSelectPageChange(e); } },\n prevOptionDots,\n options,\n postOptionDots),\n React.createElement(\"div\", { className: \"k-pager-numbers\", style: { display: this.props.type === 'numbers'\n ? ''\n : 'none' } },\n prevDots,\n numerics,\n postDots)));\n };\n Object.defineProperty(PagerNumericButtons.prototype, \"end\", {\n get: function () {\n return Math.min((this.start + this.props.buttonCount) - 1, this.props.totalPages);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PagerNumericButtons.prototype, \"start\", {\n get: function () {\n var page = this.props.currentPage;\n var buttonCount = this.props.buttonCount;\n if (page > buttonCount) {\n var reminder = (page % buttonCount);\n return (reminder === 0) ? (page - buttonCount) + 1 : (page - reminder) + 1;\n }\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n PagerNumericButtons.prototype.renderDots = function (page, ariaLabel) {\n var _this = this;\n return (React.createElement(Button, { fillMode: 'flat', themeColor: 'primary', size: this.props.size, rounded: null, role: \"button\", \"aria-label\": ariaLabel, onClick: function (e) { return _this.handlePageChange(e, page); } }, dots));\n };\n PagerNumericButtons.prototype.renderOptionDots = function (page) {\n return (React.createElement(\"option\", { value: page }, dots));\n };\n return PagerNumericButtons;\n}(React.Component));\nexport { PagerNumericButtons };\n","var _a;\n/**\n * @hidden\n */\nexport var labelsOptional = 'labels.optional';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[labelsOptional] = '(Optional)',\n _a);\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-labels',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801348,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\nimport { provideLocalizationService, registerForLocalization } from '@progress/kendo-react-intl';\nimport { labelsOptional, messages } from './messages';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from './package-metadata';\n/**\n * Represents the KendoReact FloatingLabel component.\n *\n * @example\n * ```jsx\n * const sizes = [\"X-Small\", \"Small\", \"Medium\", \"Large\", \"X-Large\", \"2X-Large\"];\n * const App = () => {\n * const [ddlState, setDdlState] = React.useState();\n * const editorId = 'ddl-sizes';\n * return (\n * \n * setDdlState(e.target.value)}\n * />\n * \n * );\n * };\n *\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nvar FloatingLabel = /** @class */ (function (_super) {\n __extends(FloatingLabel, _super);\n function FloatingLabel(props) {\n var _this = _super.call(this, props) || this;\n /**\n * @hidden\n */\n _this.state = {\n focused: false\n };\n /**\n * @hidden\n */\n _this.handleFocus = function (_) {\n _this.setState({ focused: true });\n };\n /**\n * @hidden\n */\n _this.handleBlur = function (_) {\n _this.setState({ focused: false });\n };\n validatePackage(packageMetadata);\n return _this;\n }\n /**\n * @hidden\n */\n FloatingLabel.prototype.render = function () {\n var _a = this.props, label = _a.label, editorId = _a.editorId, className = _a.className, labelClassName = _a.labelClassName, editorValue = _a.editorValue, editorPlaceholder = _a.editorPlaceholder, editorValid = _a.editorValid, editorDisabled = _a.editorDisabled, style = _a.style, id = _a.id, optional = _a.optional;\n var localizationService = provideLocalizationService(this);\n var localizedOptional = optional ? localizationService\n .toLanguageString(labelsOptional, messages[labelsOptional]) : '';\n var optionalElement = localizedOptional && (React.createElement(\"span\", { className: 'k-label-optional' }, localizedOptional));\n var spanClassNames = classNames({\n 'k-floating-label-container': true,\n 'k-focus': this.state.focused,\n 'k-empty': !editorPlaceholder && !editorValue && (editorValue !== 0),\n 'k-text-disabled': editorDisabled,\n 'k-rtl': this.props.dir === 'rtl'\n }, className);\n var labelClassNames = classNames({\n 'k-label': true,\n 'k-text-error': editorValid === false,\n 'k-text-disabled': editorDisabled\n }, labelClassName);\n return (React.createElement(\"span\", { id: this.props.id, className: spanClassNames, onFocus: this.handleFocus, onBlur: this.handleBlur, style: style, dir: this.props.dir },\n this.props.children,\n label\n ? editorId\n ? React.createElement(\"label\", { id: id, htmlFor: editorId, className: labelClassNames },\n label,\n optionalElement)\n : React.createElement(\"span\", { id: id, className: labelClassNames },\n label,\n optionalElement)\n : null));\n };\n /**\n * @hidden\n */\n FloatingLabel.propTypes = {\n label: PropTypes.string,\n editorId: PropTypes.string,\n editorValue: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]),\n editorPlaceholder: PropTypes.string,\n editorValid: PropTypes.bool,\n editorDisabled: PropTypes.bool,\n id: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n labelClassName: PropTypes.string,\n optional: PropTypes.bool\n };\n return FloatingLabel;\n}(React.Component));\nexport { FloatingLabel };\nregisterForLocalization(FloatingLabel);\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-inputs',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801559,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { guid, classNames, createPropsContext, withPropsContext } from '@progress/kendo-react-common';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\n/** @hidden */\nvar InputWithoutContext = /** @class */ (function (_super) {\n __extends(InputWithoutContext, _super);\n function InputWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n _this._input = null;\n _this._inputId = guid();\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this._input) {\n _this._input.focus();\n }\n };\n _this.isInvalid = function (state) {\n var result = false;\n for (var prop in state) {\n if (state.hasOwnProperty(prop)) {\n result = result || Boolean(state[prop]);\n }\n }\n return result;\n };\n /**\n * @hidden\n */\n _this.setValidity = function () {\n if (_this._input && _this._input.setCustomValidity) {\n _this.validity.valid || !_this.validityStyles\n ? _this._input.classList.remove('k-invalid')\n : _this._input.classList.add('k-invalid');\n _this._input.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || '');\n }\n };\n _this.handleChange = function (event) {\n _this.setState({\n value: event.target.value\n });\n _this.valueDuringOnChange = event.target.value;\n if (_this.props.onChange) {\n _this.props.onChange.call(undefined, {\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n value: event.target.value,\n target: _this\n });\n }\n _this.valueDuringOnChange = undefined;\n };\n /**\n * @hidden\n */\n _this.handleAutoFill = function (e) {\n if (e.animationName === 'autoFillStart') {\n var parent_1 = e.target.parentNode;\n if (parent_1 && parent_1.classList.contains('k-empty')) {\n parent_1.classList.remove('k-empty');\n }\n }\n };\n validatePackage(packageMetadata);\n _this.state = {\n value: _this.props.defaultValue || InputWithoutContext.defaultProps.defaultValue\n };\n return _this;\n }\n Object.defineProperty(InputWithoutContext.prototype, \"element\", {\n /**\n * Gets the native input element of the Input component.\n */\n get: function () {\n return this._input;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InputWithoutContext.prototype, \"value\", {\n /**\n * Gets the value of the Input.\n */\n get: function () {\n return this.valueDuringOnChange !== undefined\n ? this.valueDuringOnChange\n : this.props.value !== undefined\n ? this.props.value\n : this.state.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InputWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the Input.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InputWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the Input is set.\n */\n get: function () {\n var result = {\n badInput: this._input ? this._input.validity.badInput : false,\n patternMismatch: this._input\n ? this._input.validity.patternMismatch\n : false,\n rangeOverflow: this._input ? this._input.validity.rangeOverflow : false,\n rangeUnderflow: this._input ? this._input.validity.rangeUnderflow : false,\n stepMismatch: this._input ? this._input.validity.stepMismatch : false,\n tooLong: this._input ? this._input.validity.tooLong : false,\n typeMismatch: this._input ? this._input.validity.typeMismatch : false,\n valueMissing: this._input ? this._input.validity.valueMissing : false\n };\n return __assign(__assign({}, result), { customError: this.props.validationMessage !== undefined, valid: this.props.valid !== undefined\n ? this.props.valid\n : this._input\n ? !this.isInvalid(result)\n : true });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InputWithoutContext.prototype, \"validityStyles\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : InputWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n InputWithoutContext.prototype.componentDidMount = function () {\n this.forceUpdate();\n };\n /**\n * @hidden\n */\n InputWithoutContext.prototype.componentDidUpdate = function () {\n this.setValidity();\n };\n /**\n * @hidden\n */\n InputWithoutContext.prototype.render = function () {\n var _this = this;\n var _a = this.props, className = _a.className, label = _a.label, labelClassName = _a.labelClassName, id = _a.id, validationMessage = _a.validationMessage, defaultValue = _a.defaultValue, valid = _a.valid, \n // Removed to support direct use in Form Field component\n visited = _a.visited, touched = _a.touched, modified = _a.modified, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, validityStyles = _a.validityStyles, style = _a.style, ariaLabel = _a.ariaLabel, props = __rest(_a, [\"className\", \"label\", \"labelClassName\", \"id\", \"validationMessage\", \"defaultValue\", \"valid\", \"visited\", \"touched\", \"modified\", \"ariaLabelledBy\", \"ariaDescribedBy\", \"validityStyles\", \"style\", \"ariaLabel\"]);\n var inputId = id || this._inputId;\n var isValid = !this.validityStyles || this.validity.valid;\n var inputClassName = classNames(className, 'k-input k-input-md k-rounded-md k-input-solid');\n var textbox = (React.createElement(\"input\", __assign({ \"aria-labelledby\": ariaLabelledBy, \"aria-describedby\": ariaDescribedBy, \"aria-disabled\": this.props.disabled || undefined, \"aria-invalid\": !isValid || undefined, \"aria-label\": ariaLabel || undefined }, props, { style: !label\n ? style\n : undefined, value: this.value, id: inputId, className: inputClassName, onChange: this.handleChange, onAnimationStart: this.handleAutoFill, ref: function (el) {\n _this._input = el;\n } })));\n return label ?\n (React.createElement(FloatingLabel, { label: label, labelClassName: labelClassName, editorId: inputId, editorValue: String(this.value), editorValid: isValid, editorDisabled: props.disabled, editorPlaceholder: props.placeholder, children: textbox, style: style, dir: props.dir }))\n : textbox;\n };\n InputWithoutContext.displayName = 'Input';\n /**\n * @hidden\n */\n InputWithoutContext.propTypes = {\n label: PropTypes.string,\n labelClassName: PropTypes.string,\n validationMessage: PropTypes.string,\n required: PropTypes.bool,\n validate: PropTypes.bool,\n id: PropTypes.string,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n ariaLabel: PropTypes.string\n };\n /**\n * @hidden\n */\n InputWithoutContext.defaultProps = {\n defaultValue: '',\n required: false,\n validityStyles: true\n };\n return InputWithoutContext;\n}(React.Component));\nexport { InputWithoutContext };\n/**\n * Represents the PropsContext of the `Input` component.\n * Used for global configuration of all `Input` instances.\n *\n * For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.\n */\nexport var InputPropsContext = createPropsContext();\n;\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the [KendoReact Input component]({% slug overview_textbox %}).\n *\n * Accepts properties of type [InputProps]({% slug api_inputs_inputprops %}).\n * Obtaining the `ref` returns an object of type [InputHandle]({% slug api_inputs_inputhandle %}).\n */\nexport var Input = withPropsContext(InputPropsContext, InputWithoutContext);\nInput.displayName = 'KendoReactInput';\n","var _a;\n/**\n * @hidden\n */\nexport var numericIncreaseValue = 'numerictextbox.increment';\n/**\n * @hidden\n */\nexport var numericDecreaseValue = 'numerictextbox.decrement';\n/**\n * @hidden\n */\nexport var sliderIncreaseValue = 'slider.increment';\n/**\n * @hidden\n */\nexport var sliderDecreaseValue = 'slider.decrement';\n/**\n * @hidden\n */\nexport var sliderDragTitle = 'slider.dragTitle';\n/**\n * @hidden\n */\nexport var colorGradientR = 'colorGradient.r';\n/**\n * @hidden\n */\nexport var colorGradientG = 'colorGradient.g';\n/**\n * @hidden\n */\nexport var colorGradientB = 'colorGradient.b';\n/**\n * @hidden\n */\nexport var colorGradientA = 'colorGradient.a';\n/**\n * @hidden\n */\nexport var colorGradientHex = 'colorGradient.hex';\n/**\n * @hidden\n */\nexport var colorGradientContrastRatio = 'colorGradient.contrastRatio';\n/**\n * @hidden\n */\nexport var colorGradientAALevel = 'colorGradient.colorGradientAALevel';\n/**\n * @hidden\n */\nexport var colorGradientAAALevel = 'colorGradient.colorGradientAAALevel';\n/**\n * @hidden\n */\nexport var colorGradientPass = 'colorGradient.colorGradientPass';\n/**\n * @hidden\n */\nexport var colorGradientFail = 'colorGradient.colorGradientFail';\n/**\n * @hidden\n */\nexport var colorGradientHueSliderLabel = 'colorGradient.hueSliderLabel';\n/**\n * @hidden\n */\nexport var colorGradientAlphaSliderLabel = 'colorGradient.alphaSliderLabel';\n/**\n * @hidden\n */\nexport var colorGradientToggleInputsButton = 'colorGradient.toggleInputsButton';\n/**\n * @hidden\n */\nexport var flatColorPickerCancelBtn = 'flatColorPicker.cancelBtn';\n/**\n * @hidden\n */\nexport var flatColorPickerApplyBtn = 'flatColorPicker.applyBtn';\n/**\n * @hidden\n */\nexport var flatColorPickerColorGradientBtn = 'flatColorPicker.colorGradientBtn';\n/**\n * @hidden\n */\nexport var flatColorPickerColorPaletteBtn = 'flatColorPicker.colorPaletteBtn';\n/**\n * @hidden\n */\nexport var flatColorPickerClearBtn = 'flatColorPicker.clearBtn';\n/**\n * @hidden\n */\nexport var checkboxValidation = 'checkbox.validation';\n/**\n * @hidden\n */\nexport var checkboxOptionalText = 'checkbox.optionalText';\n/**\n * @hidden\n */\nexport var radioButtonValidation = 'radioButton.validation';\n/**\n * @hidden\n */\nexport var switchValidation = 'switch.validation';\n/**\n * @hidden\n */\nexport var colorPickerDropdownButtonAriaLabel = 'colorPicker.dropdownButtonAriaLabel';\n/**\n * @hidden\n */\nexport var ratingAriaLabel = 'rating.ariaLabel';\n/**\n * @hidden\n */\nexport var signatureClear = 'signature.clear';\n/**\n * @hidden\n */\nexport var signatureMaximize = 'signature.maximize';\n/**\n * @hidden\n */\nexport var signatureMinimize = 'signature.minimize';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[numericIncreaseValue] = 'Increase value',\n _a[numericDecreaseValue] = 'Decrease value',\n _a[sliderIncreaseValue] = 'Increase',\n _a[sliderDecreaseValue] = 'Decrease',\n _a[sliderDragTitle] = 'Drag',\n _a[colorGradientR] = 'r',\n _a[colorGradientG] = 'g',\n _a[colorGradientB] = 'b',\n _a[colorGradientA] = 'a',\n _a[colorGradientHex] = 'hex',\n _a[colorGradientContrastRatio] = 'Contrast ratio',\n _a[colorGradientAALevel] = 'AA',\n _a[colorGradientAAALevel] = 'AAA',\n _a[colorGradientPass] = 'Pass',\n _a[colorGradientFail] = 'Fail',\n _a[colorGradientHueSliderLabel] = 'Hue slider',\n _a[colorGradientAlphaSliderLabel] = 'Alpha slider',\n _a[colorGradientToggleInputsButton] = 'Toggle colorgradient inputs',\n _a[flatColorPickerCancelBtn] = 'Cancel',\n _a[flatColorPickerApplyBtn] = 'Apply',\n _a[flatColorPickerColorGradientBtn] = 'Color Gradient view',\n _a[flatColorPickerColorPaletteBtn] = 'Color Palette view',\n _a[flatColorPickerClearBtn] = 'Clear color value',\n _a[checkboxValidation] = 'Please check this box if you want to proceed!',\n _a[checkboxOptionalText] = '(Optional)',\n _a[radioButtonValidation] = 'Please select option if you want to proceed!',\n _a[switchValidation] = 'Please turn on if you want to proceed!',\n _a[colorPickerDropdownButtonAriaLabel] = 'Select',\n _a[ratingAriaLabel] = 'Rating',\n _a[signatureClear] = 'Clear',\n _a[signatureMaximize] = 'Maximize',\n _a[signatureMinimize] = 'Minimize',\n _a);\n","/**\n * @hidden\n */\nexport var ResultType;\n(function (ResultType) {\n ResultType[ResultType[\"Literal\"] = 0] = \"Literal\";\n ResultType[ResultType[\"Mask\"] = 1] = \"Mask\";\n ResultType[ResultType[\"Undefined\"] = 2] = \"Undefined\";\n})(ResultType || (ResultType = {}));\n/**\n * @hidden\n */\nvar Result = /** @class */ (function () {\n function Result(value, rest, type) {\n if (type === void 0) { type = ResultType.Undefined; }\n this.value = value;\n this.rest = rest;\n this.type = type;\n }\n // map :: Functor f => f a ~> (a -> b) -> f b\n Result.prototype.map = function (fn) {\n return new Result(fn(this.value), this.rest);\n };\n // chain :: Chain m => m a ~> (a -> m b) -> m b\n Result.prototype.chain = function (fn) {\n return fn(this.value, this.rest);\n };\n Result.prototype.fold = function (s, _ /* we don't need it*/) {\n return s(this.value, this.rest);\n };\n Result.prototype.concat = function (r) {\n return this.map(function (vs, _) { return r.chain(function (v, __) { return vs.concat([v]); }); });\n };\n Result.prototype.toString = function () {\n return \"Result({ value: '\".concat(this.value, \"', rest: \").concat(this.rest, \" })\");\n };\n return Result;\n}());\nexport { Result };\n","/**\n * @hidden\n */\nvar Stream = /** @class */ (function () {\n function Stream(input, control) {\n if (input === void 0) { input = []; }\n if (control === void 0) { control = []; }\n this.input = input;\n this.control = control;\n this.inputCursor = 0;\n this.controlCursor = 0;\n }\n Stream.prototype.eof = function () {\n return this.inputCursor >= this.input.length;\n };\n // Get the first value from the input.\n Stream.prototype.next = function () {\n return {\n char: this.input[this.inputCursor++],\n control: this.control[this.controlCursor++]\n };\n };\n Stream.prototype.peek = function () {\n return {\n char: this.input[this.inputCursor],\n control: this.control[this.controlCursor]\n };\n };\n Stream.prototype.eat_input = function () {\n this.inputCursor++;\n };\n Stream.prototype.eat_control = function () {\n this.controlCursor++;\n };\n Stream.prototype.eat = function () {\n this.inputCursor++;\n this.controlCursor++;\n };\n return Stream;\n}());\nexport { Stream };\n","import { Result, ResultType } from './result';\nimport { Stream } from './stream';\nvar toArray = function (value) { return (value || '').split(''); };\nvar ESCAPE_CHARACTER = '\\\\';\n/**\n * @hidden\n */\nvar Parser = /** @class */ (function () {\n function Parser(parse) {\n this.parse = parse;\n }\n Parser.prototype.run = function (input, control) {\n if (control === void 0) { control = ''; }\n if (input instanceof Stream) {\n return this.parse(input);\n }\n else {\n return this.parse(new Stream(toArray(input), toArray(control)));\n }\n };\n // map :: Functor f => f a ~> (a -> b) -> f b\n Parser.prototype.map = function (f) {\n var _this = this;\n return new Parser(function (stream) { return _this.parse(stream).map(f); });\n };\n // chain :: Chain m => m a ~> (a -> m b) -> m b\n Parser.prototype.chain = function (f) {\n var _this = this;\n return new Parser(function (stream) { return _this.parse(stream).chain(function (v, s) { return f(v).run(s); }); });\n };\n Parser.prototype.isLiteral = function (c) {\n return this.run(c).type === ResultType.Literal;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * @hidden\n */\nexport var mask = function (args) { return function (rule) { return new Parser(function (stream) {\n var prompt = args.prompt, promptPlaceholder = args.promptPlaceholder;\n while (!stream.eof()) {\n var _a = stream.peek(), char = _a.char, control = _a.control;\n if (char === control && control === prompt) {\n stream.eat();\n return new Result(prompt, stream, ResultType.Mask);\n }\n if (rule.test(char)) {\n stream.eat();\n return new Result(char, stream, ResultType.Mask);\n }\n if (char === promptPlaceholder) {\n stream.eat();\n return new Result(prompt, stream, ResultType.Mask);\n }\n stream.eat_input();\n }\n stream.eat();\n return new Result(prompt, stream, ResultType.Mask);\n}); }; };\n/**\n * @hidden\n */\nexport var literal = function (_token) { return new Parser(function (stream) {\n // let {char, control} = stream.peek();\n var char = stream.peek().char;\n if (char === _token) {\n stream.eat();\n return new Result(_token, stream, ResultType.Literal);\n }\n // if (control === _token) {\n // while (!stream.eof() && char !== _token) {\n // stream.eat_input();\n // char = stream.peek().char;\n // }\n // }\n //\n // if (control !== undefined) {\n // stream.eat();\n // }\n return new Result(_token, stream, ResultType.Literal);\n}); };\n/**\n * @hidden\n */\nexport var unmask = function (prompt) { return function (rule) { return new Parser(function (stream) {\n while (!stream.eof()) {\n var _a = stream.peek(), char = _a.char, control = _a.control;\n if (char === prompt && control === prompt) {\n stream.eat();\n return new Result(char, stream);\n }\n if (rule.test(char)) {\n stream.eat();\n return new Result(char, stream);\n }\n stream.eat_input();\n }\n stream.eat();\n return new Result('', stream);\n}); }; };\n/**\n * @hidden\n */\nexport var unliteral = function (_token) { return new Parser(function (stream) {\n if (stream.eof()) {\n return new Result('', stream);\n }\n var char = stream.peek().char;\n if (char === _token) {\n stream.eat();\n }\n return new Result(_token, stream);\n}); };\n/**\n * @hidden\n */\nexport var token = function (rules, creator) { return new Parser(function (stream) {\n var char = stream.next().char;\n var rule = rules[char];\n if (char === ESCAPE_CHARACTER) {\n char = stream.next().char;\n return new Result(creator.literal(char), stream);\n }\n if (!rule) {\n return new Result(creator.literal(char), stream);\n }\n return new Result(creator.mask(rule), stream);\n}); };\n/**\n * @hidden\n */\nexport var rawMask = function (args) { return new Parser(function (stream) {\n var prompt = args.prompt, promptPlaceholder = args.promptPlaceholder;\n var char = stream.next().char;\n if (char === prompt) {\n return new Result(promptPlaceholder, stream);\n }\n return new Result(char, stream);\n}); };\n/**\n * @hidden\n */\nexport var rawLiteral = function (includeLiterals) { return new Parser(function (stream) {\n var char = stream.next().char;\n if (includeLiterals) {\n return new Result(char, stream);\n }\n return new Result('', stream);\n}); };\n","import { Parser } from './parsers';\nimport { Result } from './result';\n/**\n * @hidden\n */\nvar always = function (value) { return new Parser(function (stream) { return new Result(value, stream); }); };\n/**\n * @hidden\n */\nvar append = function (p1, p2) { return p1.chain(function (vs) { return p2.map(function (v) { return vs.concat([v]); }); }); };\n/**\n * @hidden\n */\nexport var sequence = function (list) { return list.reduce(function (acc, parser) { return append(acc, parser); }, always([])); };\n/**\n * @hidden\n */\nexport var greedy = function (parser) { return new Parser(function (stream) {\n var result = new Result([], stream);\n while (!stream.eof()) {\n result = result.concat(parser.run(stream));\n }\n return result;\n}); };\n","import { greedy, sequence } from './parsing/combinators';\nimport { literal, mask as maskParser, rawLiteral, rawMask, token, unliteral, unmask } from './parsing/parsers';\n/**\n * @hidden\n */\nvar MaskingService = /** @class */ (function () {\n function MaskingService() {\n this.rules = {};\n this.prompt = '_';\n this.mask = '';\n this.promptPlaceholder = ' ';\n this.includeLiterals = false;\n this.maskTokens = [];\n this.unmaskTokens = [];\n this.rawTokens = [];\n this.validationTokens = [];\n }\n MaskingService.prototype.update = function (_a) {\n var _b = _a.mask, mask = _b === void 0 ? '' : _b, _c = _a.prompt, prompt = _c === void 0 ? '' : _c, _d = _a.promptPlaceholder, promptPlaceholder = _d === void 0 ? ' ' : _d, _e = _a.rules, rules = _e === void 0 ? {} : _e, _f = _a.includeLiterals, includeLiterals = _f === void 0 ? false : _f;\n this.mask = mask;\n this.prompt = prompt;\n this.promptPlaceholder = promptPlaceholder;\n this.rules = rules;\n this.includeLiterals = includeLiterals;\n this.tokenize();\n };\n MaskingService.prototype.validationValue = function (maskedValue) {\n if (maskedValue === void 0) { maskedValue = ''; }\n var value = maskedValue;\n sequence(this.validationTokens)\n .run(maskedValue)\n .fold(function (unmasked) {\n value = unmasked.join('');\n });\n return value;\n };\n MaskingService.prototype.rawValue = function (maskedValue) {\n if (maskedValue === void 0) { maskedValue = ''; }\n var value = maskedValue;\n if (!this.rawTokens.length) {\n return value;\n }\n sequence(this.rawTokens)\n .run(maskedValue)\n .fold(function (unmasked) {\n value = unmasked.join('');\n });\n return value;\n };\n /**\n * @hidden\n */\n MaskingService.prototype.maskRaw = function (rawValue) {\n if (rawValue === void 0) { rawValue = ''; }\n var value = rawValue;\n if (!this.maskTokens.length) {\n return value;\n }\n sequence(this.maskTokens)\n .run(rawValue)\n .fold(function (masked) {\n value = masked.join('');\n });\n return value;\n };\n MaskingService.prototype.maskInput = function (input, control, splitPoint) {\n if (input.length < control.length) {\n return this.maskRemoved(input, control, splitPoint);\n }\n return this.maskInserted(input, control, splitPoint);\n };\n MaskingService.prototype.maskInRange = function (pasted, oldValue, start, end) {\n var value = '';\n var selection = end;\n var beforeChange = oldValue.split('').slice(0, start);\n var afterChange = oldValue.split('').slice(end);\n sequence(this.maskTokens.slice(start, end))\n .run(pasted)\n .fold(function (masked) {\n value = beforeChange\n .concat(masked)\n .concat(afterChange)\n .join('');\n });\n return {\n selection: selection,\n value: value\n };\n };\n MaskingService.prototype.maskRemoved = function (input, control, splitPoint) {\n var _this = this;\n var value = '';\n var selection = splitPoint;\n var unchanged = input.split('').slice(splitPoint);\n var changed = input.split('').slice(0, splitPoint).join('');\n var take = this.maskTokens.length - (input.length - splitPoint);\n sequence(this.maskTokens.slice(0, take))\n .run(changed, control)\n .fold(function (masked) {\n selection = _this.adjustPosition(masked, selection);\n value = masked.concat(unchanged).join('');\n });\n return {\n selection: selection,\n value: value\n };\n };\n MaskingService.prototype.adjustPosition = function (input, selection) {\n var caretChar = input[selection];\n var isLiteral = this.maskTokens[selection].isLiteral(caretChar);\n if (!isLiteral && caretChar !== this.prompt) {\n return selection + 1;\n }\n return selection;\n };\n MaskingService.prototype.maskInserted = function (input, control, splitPoint) {\n var _this = this;\n var value = '';\n var selection = splitPoint;\n var changed = input.slice(0, splitPoint);\n sequence(this.unmaskTokens)\n .run(changed, control)\n .chain(function (unmasked) {\n selection = unmasked.join('').length;\n var unchanged = control.slice(selection);\n return sequence(_this.maskTokens)\n .run(unmasked.join('') + unchanged, control);\n })\n .fold(function (masked) {\n value = masked.join('');\n });\n return {\n selection: selection,\n value: value\n };\n };\n Object.defineProperty(MaskingService.prototype, \"maskTokenCreator\", {\n get: function () {\n var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder;\n return {\n literal: function (rule) { return literal(rule); },\n mask: function (rule) { return maskParser({ prompt: prompt, promptPlaceholder: promptPlaceholder })(rule); }\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskingService.prototype, \"unmaskTokenCreator\", {\n get: function () {\n var _this = this;\n return {\n literal: function (rule) { return unliteral(rule); },\n mask: function (rule) { return unmask(_this.prompt)(rule); }\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskingService.prototype, \"rawTokenCreator\", {\n get: function () {\n var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder, includeLiterals = _a.includeLiterals;\n return {\n literal: function (_) { return rawLiteral(includeLiterals); },\n mask: function (_) { return rawMask({ prompt: prompt, promptPlaceholder: promptPlaceholder }); }\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskingService.prototype, \"validationTokenCreator\", {\n get: function () {\n var prompt = this.prompt;\n return {\n literal: function (_) { return rawLiteral(false); },\n mask: function (_) { return rawMask({ prompt: prompt, promptPlaceholder: '' }); }\n };\n },\n enumerable: false,\n configurable: true\n });\n MaskingService.prototype.tokenize = function () {\n var _this = this;\n greedy(token(this.rules, this.maskTokenCreator))\n .run(this.mask)\n .fold(function (tokens, _) {\n _this.maskTokens = tokens;\n });\n greedy(token(this.rules, this.unmaskTokenCreator))\n .run(this.mask)\n .fold(function (tokens, _) {\n _this.unmaskTokens = tokens;\n });\n greedy(token(this.rules, this.rawTokenCreator))\n .run(this.mask)\n .fold(function (tokens, _) {\n _this.rawTokens = tokens;\n });\n greedy(token(this.rules, this.validationTokenCreator))\n .run(this.mask)\n .fold(function (tokens, _) {\n _this.validationTokens = tokens;\n });\n };\n return MaskingService;\n}());\nexport { MaskingService };\n","/**\n * @hidden\n */\nvar defaultRules = {\n '#': /[\\d\\s\\+\\-]/,\n '&': /[\\S]/,\n '0': /[\\d]/,\n '9': /[\\d\\s]/,\n '?': /[a-zA-Z\\s]/,\n 'A': /[a-zA-Z0-9]/,\n 'C': /./,\n 'L': /[a-zA-Z]/,\n 'a': /[a-zA-Z0-9\\s]/\n};\n/**\n * @hidden\n */\nvar returnFalse = function () { return false; };\n/**\n * @hidden\n */\nvar maskingChanged = function (prev, next) {\n return prev.includeLiterals !== next.includeLiterals ||\n prev.mask !== next.mask ||\n prev.prompt !== next.prompt ||\n prev.promptPlaceholder !== next.promptPlaceholder ||\n !sameRules(prev.rules, next.rules);\n};\n/**\n * @hidden\n */\nvar sameRules = function (rules1, rules2) {\n if (!!rules1 !== !!rules2) {\n return false;\n }\n if (rules1 === rules2 || (!rules1 || !rules2)) {\n return true;\n }\n var same = true;\n for (var key in rules1) {\n if (rules1[key] !== rules2[key]) {\n same = false;\n break;\n }\n }\n if (same) {\n for (var key in rules2) {\n if (!rules1.hasOwnProperty(key)) {\n same = false;\n break;\n }\n }\n }\n return same;\n};\nexport { defaultRules, maskingChanged, returnFalse };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { MaskingService } from './masking.service';\nimport { defaultRules, maskingChanged, returnFalse } from './utils';\nimport { guid, classNames, getTabIndex, withPropsContext, createPropsContext, kendoThemeMaps, useCustomComponent } from '@progress/kendo-react-common';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\n/** @hidden */\nvar MaskedTextBoxWithoutContext = /** @class */ (function (_super) {\n __extends(MaskedTextBoxWithoutContext, _super);\n function MaskedTextBoxWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /**\n * @hidden\n */\n _this.state = {};\n _this._inputId = \"k-\".concat(guid());\n _this._service = new MaskingService();\n _this._isPasted = false;\n _this._selection = [null, null];\n _this._input = null;\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this._input) {\n _this._input.focus();\n }\n };\n _this.pasteHandler = function (event) {\n var _a = event.target, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd;\n if (selectionEnd === selectionStart) {\n return;\n }\n _this._isPasted = true;\n _this._selection = [selectionStart || 0, selectionEnd || 0];\n };\n _this.onChangeHandler = function (event) {\n var input = event.currentTarget;\n var value = input.value;\n var start = _this._selection[0] || 0;\n var end = _this._selection[1] || 0;\n if (!_this.props.mask) {\n _this._isPasted = false;\n _this._selection = [null, null];\n _this.triggerOnChange(value, event);\n return;\n }\n var maskedValue = _this.value;\n var result;\n if (_this._isPasted) {\n _this._isPasted = false;\n var rightPart = maskedValue.length - end;\n var to = value.length - rightPart;\n result = _this._service.maskInRange(value.slice(start, to), maskedValue, start, end);\n }\n else {\n result = _this._service.maskInput(value, maskedValue, input.selectionStart || 0);\n }\n _this._selection = [result.selection, result.selection];\n _this.triggerOnChange(result.value, event);\n };\n _this.focusHandler = function (event) {\n if (!_this.state.focused) {\n _this.setState({ focused: true });\n if (_this.props.onFocus) {\n _this.props.onFocus.call(undefined, {\n target: _this,\n syntheticEvent: event,\n nativeEvent: event.nativeEvent\n });\n }\n }\n };\n _this.blurHandler = function (event) {\n if (_this.state.focused) {\n _this.setState({ focused: false });\n if (_this.props.onBlur) {\n _this.props.onBlur.call(undefined, {\n target: _this,\n syntheticEvent: event,\n nativeEvent: event.nativeEvent\n });\n }\n }\n };\n _this.setValidity = function () {\n if (_this.element) {\n _this.element.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || '');\n }\n };\n validatePackage(packageMetadata);\n return _this;\n }\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"element\", {\n /**\n * Gets the element of the MaskedTextBox.\n *\n * @return - An `HTMLInputElement`.\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * constructor(props) {\n * super(props);\n * }\n * element = null;\n * render() {\n * return (\n *
\n * \n * this.element = component ? component.element : null}\n * />\n * \n *
\n * );\n * }\n * }\n *\n * ReactDOM.render(\n * ,\n * document.getElementsByTagName('my-app')[0]\n * );\n * ```\n */\n get: function () {\n return this._input;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"value\", {\n /**\n * Gets the value with the mask of the MaskedTextBox.\n */\n get: function () {\n if (this._valueDuringOnChange !== undefined) {\n return this._valueDuringOnChange;\n }\n else if (this.props.value !== undefined) {\n return this.props.value;\n }\n else if (this.state.value !== undefined) {\n return this.state.value;\n }\n else if (this.props.defaultValue !== undefined) {\n return this.props.defaultValue;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"rawValue\", {\n /**\n * Gets the raw value without the mask of the MaskedTextBox.\n */\n get: function () {\n return this._service.rawValue(this.value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the MaskedTextBox is set.\n */\n get: function () {\n var maskedValue = this.value;\n var value = this._service.validationValue(maskedValue);\n var customError = this.props.validationMessage !== undefined;\n var valid = (this.props.valid !== undefined ?\n this.props.valid : ((!this.required || !!value)) &&\n (!this.props.maskValidation || !this.props.prompt || maskedValue.indexOf(this.props.prompt) === -1));\n return {\n customError: customError,\n valid: valid,\n valueMissing: !value\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"validityStyles\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : MaskedTextBoxWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"required\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : MaskedTextBoxWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the MaskedTextBox.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n MaskedTextBoxWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {\n if (this.element && this.state.focused && prevState.focused) {\n var _a = this._selection, start = _a[0], end = _a[1];\n var prevSelection = prevProps.selection;\n var nextSelection = this.props.selection;\n if ((!prevSelection && nextSelection) ||\n (prevSelection && nextSelection &&\n (prevSelection.start !== nextSelection.start || prevSelection.end !== nextSelection.end))) {\n start = nextSelection.start;\n end = nextSelection.end;\n }\n if (start !== null && end !== null) {\n this.element.setSelectionRange(start, end);\n }\n }\n if (maskingChanged(prevProps, this.props)) {\n this.updateService();\n }\n this.setValidity();\n };\n /**\n * @hidden\n */\n MaskedTextBoxWithoutContext.prototype.componentDidMount = function () {\n this.updateService();\n this.setValidity();\n };\n /**\n * @hidden\n */\n MaskedTextBoxWithoutContext.prototype.render = function () {\n var _a;\n var _this = this;\n var _b = this.props, _c = _b.size, size = _c === void 0 ? MaskedTextBoxWithoutContext.defaultProps.size : _c, _d = _b.fillMode, fillMode = _d === void 0 ? MaskedTextBoxWithoutContext.defaultProps.fillMode : _d, _e = _b.rounded, rounded = _e === void 0 ? MaskedTextBoxWithoutContext.defaultProps.rounded : _e;\n var inputId = this.props.id || this._inputId;\n var isValid = !this.validityStyles || this.validity.valid;\n var style = this.props.style || {};\n var _f = this.props, _g = _f.prefix, prefix = _g === void 0 ? MaskedTextBoxWithoutContext.defaultProps.prefix : _g, _h = _f.suffix, suffix = _h === void 0 ? MaskedTextBoxWithoutContext.defaultProps.suffix : _h;\n var Prefix = useCustomComponent(prefix)[0];\n var Suffix = useCustomComponent(suffix)[0];\n var component = (React.createElement(\"span\", { dir: this.props.dir, className: classNames('k-maskedtextbox k-input', (_a = {},\n _a[\"k-input-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _a[\"k-input-\".concat(fillMode)] = fillMode,\n _a[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,\n _a['k-invalid'] = !isValid,\n _a['k-required'] = this.required,\n _a['k-disabled'] = this.props.disabled,\n _a), this.props.className), style: !this.props.label\n ? __assign({ width: this.props.width }, style) : style },\n React.createElement(Prefix, null),\n React.createElement(\"input\", { type: \"text\", autoComplete: \"off\", autoCorrect: \"off\", autoCapitalize: \"off\", spellCheck: false, className: \"k-input-inner\", value: this.value, id: inputId, \"aria-labelledby\": this.props.ariaLabelledBy, \"aria-describedby\": this.props.ariaDescribedBy, \"aria-placeholder\": this.props.mask, name: this.props.name, tabIndex: getTabIndex(this.props.tabIndex, this.props.disabled, true), accessKey: this.props.accessKey, title: this.props.title, disabled: this.props.disabled || undefined, readOnly: this.props.readonly || undefined, placeholder: this.props.placeholder, ref: function (input) { return _this._input = input; }, onChange: this.onChangeHandler, onPaste: this.pasteHandler, onFocus: this.focusHandler, onBlur: this.blurHandler, onDragStart: returnFalse, onDrop: returnFalse }),\n React.createElement(Suffix, null)));\n return this.props.label\n ? (React.createElement(FloatingLabel, { label: this.props.label, editorId: inputId, editorValue: this.value, editorValid: isValid, editorDisabled: this.props.disabled, editorPlaceholder: this.props.placeholder, children: component, style: { width: this.props.width }, dir: this.props.dir }))\n : component;\n };\n MaskedTextBoxWithoutContext.prototype.triggerOnChange = function (maskedValue, event) {\n this.setState({\n value: maskedValue\n });\n if (this.props.onChange) {\n this._valueDuringOnChange = maskedValue;\n var ev = {\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n selectionStart: this._selection[0],\n selectionEnd: this._selection[1],\n target: this,\n value: this.value\n };\n this.props.onChange.call(undefined, ev);\n this._valueDuringOnChange = undefined;\n }\n };\n MaskedTextBoxWithoutContext.prototype.updateService = function (extra) {\n var config = Object.assign({\n includeLiterals: this.props.includeLiterals,\n mask: this.props.mask,\n prompt: this.props.prompt,\n promptPlaceholder: this.props.promptPlaceholder,\n rules: this.rules\n }, extra); // tslint:disable-line:align\n this._service.update(config);\n };\n Object.defineProperty(MaskedTextBoxWithoutContext.prototype, \"rules\", {\n get: function () {\n return Object.assign({}, defaultRules, this.props.rules);\n },\n enumerable: false,\n configurable: true\n });\n MaskedTextBoxWithoutContext.displayName = 'MaskedTextBox';\n /**\n * @hidden\n */\n MaskedTextBoxWithoutContext.propTypes = {\n value: PropTypes.string,\n defaultValue: PropTypes.string,\n placeholder: PropTypes.string,\n title: PropTypes.string,\n dir: PropTypes.string,\n id: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n prefix: PropTypes.any,\n suffix: PropTypes.any,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n width: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n tabIndex: PropTypes.number,\n accessKey: PropTypes.string,\n disabled: PropTypes.bool,\n readonly: PropTypes.bool,\n prompt: PropTypes.string,\n promptPlaceholder: PropTypes.string,\n includeLiterals: PropTypes.bool,\n maskValidation: PropTypes.bool,\n mask: PropTypes.string,\n rules: function (props, propName, componentName) {\n var rules = props.rules;\n if (rules !== undefined) {\n var valid = Object.entries(rules)\n .some(function (e) { return typeof e !== 'string' || !(rules[e] instanceof RegExp); });\n if (!valid) {\n return new Error('Invalid prop `' + propName + '` supplied to' +\n ' `' + componentName + '`. Validation failed.');\n }\n }\n return null;\n },\n selection: PropTypes.shape({\n start: PropTypes.number.isRequired,\n end: PropTypes.number.isRequired\n }),\n name: PropTypes.string,\n label: PropTypes.string,\n validationMessage: PropTypes.string,\n required: PropTypes.bool,\n valid: PropTypes.bool,\n validityStyles: PropTypes.bool,\n onChange: PropTypes.func,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])\n };\n /**\n * @hidden\n */\n MaskedTextBoxWithoutContext.defaultProps = {\n prompt: '_',\n promptPlaceholder: ' ',\n includeLiterals: false,\n maskValidation: true,\n rules: defaultRules,\n required: false,\n validityStyles: true,\n prefix: function (_) { return null; },\n suffix: function (_) { return null; },\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid'\n };\n return MaskedTextBoxWithoutContext;\n}(React.Component));\nexport { MaskedTextBoxWithoutContext };\n/**\n * Represents the PropsContext of the `MaskedTextBox` component.\n * Used for global configuration of all `MaskedTextBox` instances.\n *\n * For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.\n */\nexport var MaskedTextBoxPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the props of the [KendoReact MaskedTextBox component]({% slug overview_maskedtextbox %}).\n *\n * Accepts properties of type [MaskedTextBoxProps]({% slug api_inputs_maskedtextboxprops %}).\n * Obtaining the `ref` returns an object of type [MaskedTextBoxHandle]({% slug api_inputs_maskedtextboxhandle %}).\n */\nexport var MaskedTextBox = withPropsContext(MaskedTextBoxPropsContext, MaskedTextBoxWithoutContext);\nMaskedTextBox.displayName = 'KendoReactMaskedTextBox';\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar DEFAULT_NUMBER = 1111111.1111111;\nvar MAX_DECIMAL = 0.31111111111111117;\nvar MIN_DECIMAL = 1;\nvar ONE_NUMBER = 1;\nvar ZERO_NUMBER = 0;\nvar DIGITS_REGEX = /\\d/;\nvar MAX_PRECISION = 15;\n/**\n * @hidden\n */\nexport var getInitialState = function () { return ({\n eventValue: null,\n prevLooseValue: '',\n currentLooseValue: '',\n focused: false,\n selectionStart: undefined,\n selectionEnd: undefined,\n decimalSelect: false,\n valueIsCorrected: false,\n valueIsOutOfRange: false\n}); };\n/**\n * @hidden\n */\nexport var getStateOrPropsValue = function (value, stateValue) {\n return value !== undefined ? value : stateValue;\n};\n/**\n * @hidden\n */\nexport var formatValue = function (value, format, intlService) {\n if (value === null && value === undefined) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n return intlService.formatNumber(value, format);\n};\n/**\n * @hidden\n */\nexport var fractionLength = function (value) {\n return (String(value).split('.')[1] || '').length;\n};\n/**\n * @hidden\n */\nvar maxFractionLength = function (value1, value2) {\n return Math.max(fractionLength(value1), fractionLength(value2));\n};\n/**\n * @hidden\n */\nexport var limitPrecision = function (precision) { return Math.min(precision, MAX_PRECISION); };\n/**\n * @hidden\n */\nexport var toFixedPrecision = function (value, precision) {\n var maxPrecision = limitPrecision(precision);\n return parseFloat(value.toFixed(maxPrecision));\n};\n/**\n * @hidden\n */\nexport var increaseValue = function (value, newState, step, min, max, format, intlService) {\n var maxPrecision = maxFractionLength(value || 0, step || 0);\n var increasedValue = rangeValue(toFixedPrecision((value || 0) + (step || 0), maxPrecision), min, max);\n newState.eventValue = increasedValue;\n newState.currentLooseValue = formatValue(increasedValue, format, intlService);\n newState.selectionStart = newState.selectionEnd = getLastNumberIndex(newState.currentLooseValue, DIGITS_REGEX);\n};\n/**\n * @hidden\n */\nexport var decreaseValue = function (value, newState, step, min, max, format, intlService) {\n var maxPrecision = maxFractionLength(value || 0, step || 0);\n var decreasedValue = rangeValue(toFixedPrecision((value || 0) - (step || 0), maxPrecision), min, max);\n newState.eventValue = decreasedValue;\n newState.currentLooseValue = formatValue(decreasedValue, format, intlService);\n newState.selectionStart = newState.selectionEnd = getLastNumberIndex(newState.currentLooseValue, DIGITS_REGEX);\n};\n/**\n * @hidden\n */\nexport var rangeValue = function (value, min, max) {\n if (value == null) {\n return value;\n }\n if (!(value > 1 || value < 1 || value === 1)) {\n // null, undefined or NaN\n return null;\n }\n if (max !== undefined && min !== undefined && max < min) {\n return null;\n }\n if (max !== undefined && value > max) {\n value = max;\n }\n if (min !== undefined && value < min) {\n value = min;\n }\n return value;\n};\n/**\n * @hidden\n */\nexport var getMaxCursorPosition = function (nextValue, formatInfo) {\n var formatSuffixIndex = formatInfo.findIndex(function (_a) {\n var _ = _a[0], currSuffix = _a[1];\n return Boolean(currSuffix) && nextValue.indexOf(currSuffix) === nextValue.length - currSuffix.length;\n });\n if (formatSuffixIndex === -1) {\n return -1;\n }\n var suffix = formatInfo[formatSuffixIndex][1];\n return nextValue.length - suffix.length;\n};\n/**\n * @hidden\n */\nexport var getMinCursorPosition = function (nextValue, formatInfo) {\n var formatPrefixIndex = formatInfo.findIndex(function (_a) {\n var currPrefix = _a[0], _ = _a[1];\n return Boolean(currPrefix) && nextValue.indexOf(currPrefix) === 0;\n });\n if (formatPrefixIndex === -1) {\n return -1;\n }\n var prefix = formatInfo[formatPrefixIndex][0];\n return prefix.length;\n};\n/**\n * @hidden\n */\nexport var rangeSelection = function (nextLooseValue, formatInfo, newState) {\n var maxPosition = getMaxCursorPosition(nextLooseValue, formatInfo);\n if (maxPosition !== -1 && newState.selectionStart > maxPosition) {\n newState.selectionStart = newState.selectionEnd = maxPosition;\n return;\n }\n if (newState.selectionStart > nextLooseValue.length) {\n newState.selectionStart = newState.selectionEnd = nextLooseValue.length;\n }\n var minPosition = getMinCursorPosition(nextLooseValue, formatInfo);\n if (minPosition !== -1 && newState.selectionStart < minPosition) {\n newState.selectionStart = newState.selectionEnd = minPosition;\n }\n if (newState.selectionStart === -1) {\n newState.selectionStart = newState.selectionEnd = 0;\n }\n};\n/**\n * @hidden\n */\nexport var setSelection = function (newState, newIndex, nextLooseValue, formatInfo) {\n newState.selectionStart = newState.selectionEnd = newIndex;\n rangeSelection(nextLooseValue, formatInfo, newState);\n};\n/**\n * @hidden\n */\nexport var setInvalid = function (newState, format, formatInfo, intlService) {\n newState.eventValue = intlService.parseNumber(newState.prevLooseValue, format);\n newState.currentLooseValue = newState.prevLooseValue;\n newState.valueIsCorrected = true;\n setSelection(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);\n};\n/**\n * @hidden\n */\nexport var isMinusSymbolAdded = function (newState, symbols) {\n var newText = String(newState.currentLooseValue);\n var oldText = String(newState.prevLooseValue);\n return (newText.split(symbols.minusSign).length !== oldText.split(symbols.minusSign).length &&\n newText.length === oldText.length + symbols.minusSign.length);\n};\n/**\n * @hidden\n */\nexport var isMinusSymbolRemoved = function (newState, symbols) {\n var newText = String(newState.currentLooseValue);\n var oldText = String(newState.prevLooseValue);\n return (newText.indexOf(symbols.minusSign) === -1 && oldText.indexOf(symbols.minusSign) !== -1);\n};\n/**\n * @hidden\n */\nexport var isDecimalDuplicated = function (newState, symbols) {\n var newText = String(newState.currentLooseValue);\n return newText.split(symbols.decimal).length > 2;\n};\n/**\n * @hidden\n */\nexport var getFormatPrefixSufix = function (format, intlService) {\n var positiveResult = intlService.formatNumber(DEFAULT_NUMBER, format);\n var negativeResult = intlService.formatNumber(-DEFAULT_NUMBER, format);\n var zeroResult = intlService.formatNumber(ZERO_NUMBER, format);\n var oneResult = intlService.formatNumber(ONE_NUMBER, format);\n var positivePrefix = getPrefix(positiveResult);\n var negativePrefix = getPrefix(negativeResult);\n var zeroPrefix = getPrefix(zeroResult);\n var onePrefix = getPrefix(oneResult);\n var positiveSuffix = getSuffix(positiveResult);\n var negativeSuffix = getSuffix(negativeResult);\n var zeroSuffix = getSuffix(zeroResult);\n var oneSuffix = getSuffix(oneResult);\n return {\n positiveInfo: [positivePrefix, positiveSuffix],\n negativeInfo: [negativePrefix, negativeSuffix],\n zeroInfo: [zeroPrefix, zeroSuffix],\n oneInfo: [onePrefix, oneSuffix]\n };\n};\n/**\n * @hidden\n */\nexport var getFormatSymbols = function (format, intlService) {\n var positiveResult = intlService.formatNumber(DEFAULT_NUMBER, format);\n var negativeResult = intlService.formatNumber(-DEFAULT_NUMBER, format);\n var zeroResult = intlService.formatNumber(ZERO_NUMBER, format);\n var oneResult = intlService.formatNumber(ONE_NUMBER, format);\n var symbols = intlService.numberSymbols();\n var sanitizeRegex = new RegExp(\"[\\\\d\\\\\".concat(symbols.decimal).concat(symbols.group, \"]\"), 'g');\n var resultWithDuplicates = [positiveResult, negativeResult, zeroResult, oneResult]\n .map(function (result) { return result.replace(sanitizeRegex, ''); })\n .join('');\n return resultWithDuplicates\n .split('')\n .filter(function (x, n, s) { return s.indexOf(x) === n; })\n .join('');\n};\n/**\n * @hidden\n */\nexport var getInitialPosition = function (nextLooseValue, symbols) {\n var decimalIdex = nextLooseValue.indexOf(symbols.decimal);\n if (decimalIdex > -1) {\n return decimalIdex;\n }\n return getLastNumberIndex(nextLooseValue, DIGITS_REGEX);\n};\n/**\n * @hidden\n */\nexport var reverseString = function (str) {\n return str.split('').reverse().join('');\n};\n/**\n * @hidden\n */\nexport var getLastNumberIndex = function (currentLooseValue, inputRegex) {\n return currentLooseValue.length - reverseString(currentLooseValue).search(inputRegex);\n};\n/**\n * @hidden\n */\nexport var getPrefix = function (str) {\n return str.split(str[str.search(DIGITS_REGEX)])[0];\n};\n/**\n * @hidden\n */\nexport var getSuffix = function (str) {\n var reversedString = reverseString(str);\n return reverseString(reversedString.split(reversedString[reversedString.search(DIGITS_REGEX)])[0]);\n};\n/**\n * @hidden\n */\nexport var getFirstNumberIndex = function (prevLooseValue, inputRegex) {\n return prevLooseValue.search(inputRegex);\n};\n/**\n * @hidden\n */\nexport var getDecimalCount = function (value, decimal) {\n var currentDecimalPlace = value.indexOf(decimal);\n return currentDecimalPlace > -1 ? value.length - currentDecimalPlace - 1 : 0;\n};\n/**\n * @hidden\n */\nexport var changeBasedSelection = function (currentValue, nextValue, selectionPosition, isDelete, sanitizeRegex) {\n var isCurrentLeadingZero = currentValue.replace(sanitizeRegex, '')[0] === '0';\n var isNextLeadingZero = nextValue.replace(sanitizeRegex, '')[0] === '0';\n if (isCurrentLeadingZero && !isNextLeadingZero) {\n return selectionPosition - 1;\n }\n if (isNextLeadingZero && isDelete) {\n return selectionPosition + 1;\n }\n var numberCounter = 0;\n for (var idx = 0; idx < selectionPosition; idx++) {\n if (DIGITS_REGEX.test(currentValue.charAt(idx))) {\n numberCounter++;\n }\n }\n var newSelection = 0;\n while (numberCounter > 0 && nextValue.length > newSelection) {\n if (DIGITS_REGEX.test(nextValue.charAt(newSelection))) {\n numberCounter--;\n }\n newSelection++;\n }\n return newSelection;\n};\n/**\n * @hidden\n */\nexport var sanitizeNumber = function (state, format, intlService) {\n var newState = __assign({}, state);\n var prevLooseValue = newState.prevLooseValue;\n var symbols = intlService.numberSymbols();\n var restrictedSymbols = getFormatSymbols(format, intlService);\n var currentLooseValueAsString = String(newState.currentLooseValue);\n var prevLooseValueAsString = String(prevLooseValue);\n var sanitizeRegex = new RegExp(\"[^\\\\d\\\\\".concat(symbols.decimal, \"]\"), 'g');\n var sanitizeGroupRegex = new RegExp(\"[^\\\\d\\\\\".concat(symbols.decimal, \"\\\\\").concat(symbols.group, \"]\"), 'g');\n var allSymbolsRegex = new RegExp(\"[\\\\d\\\\\".concat(symbols.decimal, \"\\\\\").concat(symbols.group, \"]\"));\n var sanitizedString = currentLooseValueAsString.replace(sanitizeRegex, '');\n var numberStart = getFirstNumberIndex(currentLooseValueAsString, DIGITS_REGEX);\n var numberEnd = numberStart === -1 ? -1 : getLastNumberIndex(currentLooseValueAsString, DIGITS_REGEX);\n var decimalIndex = currentLooseValueAsString.indexOf(symbols.decimal);\n var sanitizedFormattedString = (currentLooseValueAsString.substring(0, numberStart) +\n currentLooseValueAsString.substring(numberStart, numberEnd).replace(sanitizeGroupRegex, '') +\n currentLooseValueAsString.substring(numberEnd, currentLooseValueAsString.length))\n .split('')\n .filter(function (s) { return restrictedSymbols.indexOf(s) !== -1 || s.search(allSymbolsRegex) !== -1; })\n .join('');\n var formattedMax = intlService.formatNumber(MAX_DECIMAL, format).replace(sanitizeRegex, '');\n var maxDecimalIndex = formattedMax.indexOf(symbols.decimal);\n var maxDecimalCount = maxDecimalIndex > -1 ? formattedMax.length - maxDecimalIndex - 1 : 0;\n var formattedMin = intlService.formatNumber(MIN_DECIMAL, format).replace(sanitizeRegex, '');\n var minDecimalIndex = formattedMin.indexOf(symbols.decimal);\n var minDecimalCount = minDecimalIndex > -1 ? formattedMin.length - minDecimalIndex - 1 : 0;\n var _a = getFormatPrefixSufix(format, intlService), positiveInfo = _a.positiveInfo, negativeInfo = _a.negativeInfo, zeroInfo = _a.zeroInfo, oneInfo = _a.oneInfo;\n var formatInfo = [positiveInfo, negativeInfo, zeroInfo, oneInfo];\n var isFormatContainPrefixSuffix = formatInfo.findIndex(function (info) { return info.findIndex(function (nestedInfo) { return Boolean(nestedInfo); }) !== -1; }) !== 1;\n var isDelete = currentLooseValueAsString.length > 0 && currentLooseValueAsString.length < prevLooseValueAsString.length;\n var isPercentFormat = typeof format === 'string' &&\n format[0] === 'p' &&\n currentLooseValueAsString &&\n currentLooseValueAsString.indexOf(symbols.percentSign) === -1;\n if (!newState.isPaste) {\n // 1. Empty input\n if (currentLooseValueAsString === '') {\n newState.eventValue = null;\n newState.currentLooseValue = '';\n return newState;\n }\n // 2. Check is minus sign\n if (newState.currentLooseValue === symbols.minusSign && intlService.formatNumber(-0, format) !== prevLooseValueAsString) {\n newState.eventValue = -0;\n newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);\n setSelection(newState, getInitialPosition(newState.currentLooseValue, symbols), newState.currentLooseValue, formatInfo);\n return newState;\n }\n // 3. Check is decimal symbol\n if (newState.currentLooseValue === symbols.decimal) {\n newState.eventValue = 0;\n var valueCandidate = formatValue(newState.eventValue, format, intlService);\n if (minDecimalCount === 0 && maxDecimalCount > 0) {\n var currentLastNumberIndex = getLastNumberIndex(valueCandidate, DIGITS_REGEX);\n newState.currentLooseValue = valueCandidate.substring(0, currentLastNumberIndex) +\n symbols.decimal +\n valueCandidate.substring(currentLastNumberIndex);\n }\n else {\n newState.currentLooseValue = valueCandidate;\n }\n setSelection(newState, getInitialPosition(newState.currentLooseValue, symbols) + 1, newState.currentLooseValue, formatInfo);\n return newState;\n }\n // 4. Minus sign toggle\n if (isMinusSymbolAdded(newState, symbols)) {\n var nextValue = intlService.parseNumber(prevLooseValue, format);\n newState.eventValue = -(nextValue !== null ? nextValue : 0);\n newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);\n var currentNumberStart = getFirstNumberIndex(newState.currentLooseValue, DIGITS_REGEX);\n var oldNumberStart = getFirstNumberIndex(prevLooseValueAsString, DIGITS_REGEX);\n setSelection(newState, newState.selectionEnd - 1 + (currentNumberStart - oldNumberStart), newState.currentLooseValue, formatInfo);\n return newState;\n }\n if (isMinusSymbolRemoved(newState, symbols)) {\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n setSelection(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);\n return newState;\n }\n // 5. Duplicate decimal - it's possible only as trailing\n if (isDecimalDuplicated(newState, symbols)) {\n setInvalid(newState, format, formatInfo, intlService);\n return newState;\n }\n // 6. Percent format\n if (isPercentFormat) {\n newState.eventValue = intlService.parseNumber(currentLooseValueAsString, format) / 100;\n newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);\n return newState;\n }\n // 7. More than 15 numeric symbols\n var numericSymbols = String(newState.currentLooseValue).replace(/[^\\d]/g, '');\n if (numericSymbols.length > MAX_PRECISION) {\n setInvalid(newState, format, formatInfo, intlService);\n return newState;\n }\n // 8. Check prefix / suffix for modifications\n if (sanitizedString !== currentLooseValueAsString &&\n currentLooseValueAsString &&\n isFormatContainPrefixSuffix) {\n var formatInfoIndex = formatInfo.findIndex(function (_a) {\n var prefix = _a[0], suffix = _a[1];\n var prefixIndex = currentLooseValueAsString.indexOf(prefix);\n var suffixIndex = currentLooseValueAsString.indexOf(suffix);\n var prefixFound = prefixIndex === 0;\n var suffixFound = suffixIndex === currentLooseValueAsString.length - suffix.length;\n var prefixGap = prefixIndex + prefix.length !== numberStart &&\n numberStart !== -1 &&\n currentLooseValueAsString[prefixIndex + prefix.length] !== symbols.decimal;\n var suffixGap = suffixIndex !== numberEnd &&\n numberEnd !== -1 &&\n currentLooseValueAsString[suffixIndex - 1] !== symbols.decimal;\n if (prefix && suffix) {\n if (prefixGap || suffixGap) {\n return false;\n }\n return prefixFound && suffixFound;\n }\n if (prefix) {\n if (prefixGap) {\n return false;\n }\n return prefixFound;\n }\n if (suffix) {\n if (suffixGap) {\n return false;\n }\n return suffixFound;\n }\n return false;\n });\n if (formatInfoIndex === -1) {\n setInvalid(newState, format, formatInfo, intlService);\n return newState;\n }\n }\n // 9. Value ending on decimal separator (here as decimal might be typed inside format)\n if (sanitizedString[sanitizedString.length - 1] === symbols.decimal && maxDecimalCount > 0) {\n newState.eventValue = intlService.parseNumber(currentLooseValueAsString, format);\n newState.currentLooseValue = sanitizedFormattedString;\n return newState;\n }\n // 10. prevent deleting decimal and group symbols\n if (newState.currentLooseValue && prevLooseValue) {\n var isSpecialSymbolDeleted = (restrictedSymbols + symbols.decimal + symbols.group)\n .split('')\n .findIndex(function (s) {\n if (currentLooseValueAsString.split('').filter(function (x) { return x === s; }).length <\n prevLooseValueAsString.split('').filter(function (x) { return x === s; }).length &&\n currentLooseValueAsString.length + 1 === prevLooseValueAsString.length) {\n if (s === symbols.decimal &&\n getDecimalCount(prevLooseValueAsString.replace(sanitizeRegex, ''), symbols.decimal) === 0) {\n return false;\n }\n return true;\n }\n return false;\n }) > -1;\n if (isSpecialSymbolDeleted) {\n newState.eventValue = intlService.parseNumber(state.prevLooseValue, format);\n newState.currentLooseValue = state.prevLooseValue;\n return newState;\n }\n }\n var currentDecimalCount = getDecimalCount(sanitizedString, symbols.decimal);\n var endsOnDecimal = sanitizedString[sanitizedString.length - 1] === '0';\n // 11. Deleting more decimals than allowed\n if (isDelete && endsOnDecimal && currentDecimalCount < minDecimalCount) {\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);\n return newState;\n }\n // 12. Ending on zero OR more decimals than allowed\n if (currentDecimalCount > 0) {\n var valueUntillDecimal = currentLooseValueAsString.substring(0, decimalIndex);\n if (endsOnDecimal && (!valueUntillDecimal || prevLooseValueAsString.indexOf(valueUntillDecimal) !== 0)) {\n // ending on zero but typing before decimal separator\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n var nextLooseValue = formatValue(newState.eventValue, format, intlService);\n setSelection(newState, changeBasedSelection(currentLooseValueAsString, nextLooseValue, newState.selectionEnd, isDelete, sanitizeRegex), nextLooseValue, formatInfo);\n newState.currentLooseValue = nextLooseValue;\n return newState;\n }\n if (currentDecimalCount > maxDecimalCount) {\n // typing more symbols than format allows\n var looseDecimalPlace = currentLooseValueAsString.indexOf(symbols.decimal);\n var result = currentLooseValueAsString.substring(0, looseDecimalPlace) +\n currentLooseValueAsString.substring(looseDecimalPlace, looseDecimalPlace + 1 + maxDecimalCount) +\n currentLooseValueAsString.substring(numberEnd, String(newState.currentLooseValue).length);\n newState.eventValue = intlService.parseNumber(result, format);\n newState.currentLooseValue = result;\n setSelection(newState, newState.selectionStart, result, formatInfo);\n return newState;\n }\n if (minDecimalCount !== maxDecimalCount && currentDecimalCount <= maxDecimalCount && endsOnDecimal) {\n // adding trailing zeroes\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n newState.currentLooseValue = sanitizedFormattedString;\n return newState;\n }\n if (currentDecimalCount < minDecimalCount) {\n // deleting more decimals than allowed\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);\n return newState;\n }\n }\n }\n // X. All other values should be parsed\n newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);\n if (isPercentFormat) {\n newState.eventValue = newState.eventValue / 100;\n }\n if (typeof newState.eventValue === 'number') {\n var nextLooseValue = formatValue(newState.eventValue, format, intlService);\n // First digit add\n if (currentLooseValueAsString.length === 1) {\n setSelection(newState, getInitialPosition(nextLooseValue, symbols), nextLooseValue, formatInfo);\n }\n else {\n setSelection(newState, changeBasedSelection(currentLooseValueAsString, nextLooseValue, newState.selectionEnd, isDelete, sanitizeRegex), nextLooseValue, formatInfo);\n }\n newState.currentLooseValue = nextLooseValue;\n }\n else {\n // Case when deleting last number\n newState.currentLooseValue = formatValue(intlService.parseNumber(sanitizedString), format, intlService);\n }\n return newState;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { useInternationalization, useLocalization } from '@progress/kendo-react-intl';\nimport { classNames, guid, getTabIndex, dispatchEvent, createPropsContext, usePropsContext, kendoThemeMaps, useCustomComponent, getActiveElement } from '@progress/kendo-react-common';\nimport { caretAltUpIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport { numericIncreaseValue, messages, numericDecreaseValue } from '../messages';\nimport { formatValue, sanitizeNumber, rangeValue, increaseValue, decreaseValue, getStateOrPropsValue, getInitialState } from './utils';\nimport { Button } from '@progress/kendo-react-buttons';\nvar VALIDATION_MESSAGE = 'Please enter a valid value!';\n/**\n * Represents the PropsContext of the `NumericTextBox` component.\n * Used for global configuration of all `NumericTextBox` instances.\n *\n * For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.\n */\nexport var NumericTextBoxPropsContext = createPropsContext();\n/**\n * Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).\n */\nexport var NumericTextBox = React.forwardRef(function (directProps, target) {\n var _a;\n validatePackage(packageMetadata);\n var props = usePropsContext(NumericTextBoxPropsContext, directProps);\n var calculatedId = React.useMemo(function () { return guid(); }, []);\n var inputId = props.id || calculatedId;\n var intlService = useInternationalization();\n var localizationService = useLocalization();\n var elementRef = React.useRef(null);\n var valueDuringChangeRef = React.useRef();\n var _b = React.useState(false), forceUpdate = _b[0], setForceUpdate = _b[1];\n var stateRef = React.useRef(getInitialState());\n var isPasteRef = React.useRef(false);\n var prevLooseValueRef = React.useRef();\n var stateValueRef = React.useRef(props.defaultValue);\n var looseValue = formatValue(stateRef.current.focused && !props.disabled ?\n stateRef.current.currentLooseValue :\n getStateOrPropsValue(props.value, stateValueRef.current), props.format, intlService);\n prevLooseValueRef.current = looseValue;\n var Prefix = useCustomComponent(props.prefix)[0];\n var Suffix = useCustomComponent(props.suffix)[0];\n React.useEffect(function () {\n if (elementRef.current && elementRef.current.setCustomValidity) {\n elementRef.current.setCustomValidity(validityGetter().valid\n ? ''\n : props.validationMessage || VALIDATION_MESSAGE);\n }\n });\n var focusElement = React.useCallback(function () {\n if (elementRef.current) {\n elementRef.current.focus();\n }\n }, []);\n var valueGetter = React.useCallback(function () {\n if (valueDuringChangeRef.current !== undefined) {\n return valueDuringChangeRef.current;\n }\n else {\n return getStateOrPropsValue(props.value, stateValueRef.current);\n }\n }, [props.value]);\n var nameGetter = React.useCallback(function () {\n return props.name;\n }, [props.name]);\n var requiredGetter = React.useCallback(function () {\n return props.required;\n }, [props.required]);\n var validityGetter = React.useCallback(function () {\n var customError = props.validationMessage !== undefined;\n var currentValue = valueGetter();\n var valid = props.valid !== undefined ?\n props.valid :\n !stateRef.current.valueIsOutOfRange &&\n (!requiredGetter() || (currentValue !== null && currentValue !== undefined));\n return {\n customError: customError,\n valid: valid,\n valueMissing: currentValue === null || currentValue === undefined\n };\n }, [props.validationMessage, props.valid, valueGetter, requiredGetter]);\n var validityStylesGetter = React.useCallback(function () {\n return props.validityStyles;\n }, [props.validityStyles]);\n var propsGetter = React.useCallback(function () {\n return props;\n }, [props]);\n var getImperativeHandle = React.useCallback(function () {\n var options = {\n element: elementRef.current,\n focus: focusElement\n };\n Object.defineProperty(options, 'name', { get: nameGetter });\n Object.defineProperty(options, 'value', { get: valueGetter });\n Object.defineProperty(options, 'validity', { get: validityGetter });\n Object.defineProperty(options, 'validityStyles', { get: validityStylesGetter });\n Object.defineProperty(options, 'required', { get: requiredGetter });\n Object.defineProperty(options, 'props', { get: propsGetter });\n return options;\n }, [nameGetter, valueGetter, validityGetter, validityStylesGetter, requiredGetter, focusElement, propsGetter]);\n React.useImperativeHandle(target, getImperativeHandle);\n var getCurrentState = React.useCallback(function () {\n return {\n eventValue: getStateOrPropsValue(props.value, stateValueRef.current),\n prevLooseValue: prevLooseValueRef.current,\n currentLooseValue: elementRef.current.value,\n selectionStart: elementRef.current.selectionStart,\n selectionEnd: elementRef.current.selectionEnd,\n decimalSelect: false,\n valueIsCorrected: false,\n valueIsOutOfRange: false,\n isPaste: isPasteRef.current,\n focused: stateRef.current.focused\n };\n }, [props.value]);\n var triggerChange = React.useCallback(function (event, newState) {\n if (props.disabled) {\n return;\n }\n valueDuringChangeRef.current = newState.eventValue;\n stateValueRef.current = newState.eventValue;\n var formattedValue = formatValue(rangeValue(newState.eventValue, props.min, props.max), props.format, intlService);\n var rangedValue = rangeValue(intlService.parseNumber(formattedValue, props.format), props.min, props.max);\n if (rangedValue !== newState.eventValue) {\n newState.valueIsOutOfRange = true;\n newState.eventValue = rangedValue;\n stateValueRef.current = rangedValue;\n }\n var shouldFireEvent = props.value !== newState.eventValue;\n if (shouldFireEvent) {\n dispatchEvent(props.onChange, event, getImperativeHandle(), { value: newState.eventValue });\n }\n valueDuringChangeRef.current = undefined;\n stateRef.current = newState;\n setForceUpdate(function (_x) { return !_x; });\n }, [props.value, props.onChange, props.disabled, setForceUpdate, getImperativeHandle]);\n var onChangeHandler = React.useCallback(function (event) {\n var stateCandidate = getCurrentState();\n isPasteRef.current = false;\n triggerChange(event, sanitizeNumber(stateCandidate, props.format, intlService));\n }, [props.format, props.onChange, intlService, triggerChange, getCurrentState]);\n var onKeyDown = React.useCallback(function (event) {\n var newState = getCurrentState();\n var currentValue = intlService.parseNumber(String(newState.currentLooseValue), props.format);\n // Select All\n if (newState.selectionEnd > newState.selectionStart &&\n newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {\n var numericSymbols = intlService.numberSymbols();\n var isMinus = numericSymbols && event.key === numericSymbols.minusSign;\n var isDecimal = numericSymbols && event.key === numericSymbols.decimal;\n isPasteRef.current = !isMinus && !isDecimal;\n return;\n }\n switch (event.keyCode) {\n case 38:\n // Arrow up\n increaseValue(currentValue, newState, props.step, props.min, props.max, props.format, intlService);\n break;\n case 40:\n // Arrow down\n decreaseValue(currentValue, newState, props.step, props.min, props.max, props.format, intlService);\n break;\n case 13:\n // Enter - range values\n if (props.rangeOnEnter === false) {\n return;\n }\n var formattedValue = formatValue(rangeValue(currentValue, props.min, props.max), props.format, intlService);\n var rangedValue = rangeValue(intlService.parseNumber(formattedValue, props.format), props.min, props.max);\n newState.eventValue = rangedValue;\n newState.currentLooseValue = formatValue(rangedValue, props.format, intlService);\n newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;\n break;\n case 110:\n // Numpad decimal key\n var element = elementRef.current;\n var symbols = intlService.numberSymbols();\n if (element) {\n newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) +\n symbols.decimal +\n newState.currentLooseValue.slice(newState.selectionEnd);\n newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;\n newState = sanitizeNumber(newState, props.format, intlService);\n }\n break;\n default:\n return;\n }\n event.preventDefault();\n triggerChange(event, newState);\n }, [props.format, props.min, props.max, props.step, props.onChange, props.rangeOnEnter, triggerChange, getCurrentState]);\n var onPasteHandler = React.useCallback(function () {\n isPasteRef.current = true;\n }, []);\n var onIncrease = React.useCallback(function (event) {\n if (props.readOnly ||\n props.disabled) {\n return;\n }\n var newState = getCurrentState();\n increaseValue(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);\n triggerChange(event, newState);\n }, [props.format, props.min, props.max, props.step, props.onChange, props.readOnly, props.disabled, triggerChange, getCurrentState]);\n var onDecrease = React.useCallback(function (event) {\n if (props.readOnly ||\n props.disabled) {\n return;\n }\n var newState = getCurrentState();\n decreaseValue(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);\n triggerChange(event, newState);\n }, [props.format, props.min, props.max, props.step, props.onChange, props.readOnly, props.disabled, triggerChange, getCurrentState]);\n var onWheelHandler = React.useCallback(function (event) {\n var activeElement = getActiveElement(document);\n if (!document ||\n activeElement !== elementRef.current ||\n !elementRef.current ||\n props.readOnly ||\n props.disabled) {\n return;\n }\n if (event.nativeEvent.deltaY < 0) {\n onIncrease(event);\n }\n if (event.nativeEvent.deltaY > 0) {\n onDecrease(event);\n }\n }, [onIncrease, onDecrease, props.disabled, props.readOnly]);\n var onFocus = React.useCallback(function (event) {\n stateRef.current.currentLooseValue = prevLooseValueRef.current;\n stateRef.current.focused = true;\n dispatchEvent(props.onFocus, event, getImperativeHandle(), {});\n setForceUpdate(function (x) { return !x; });\n }, [props.onFocus, setForceUpdate, getImperativeHandle]);\n var onBlur = React.useCallback(function (event) {\n stateRef.current = getInitialState();\n dispatchEvent(props.onBlur, event, getImperativeHandle(), {});\n setForceUpdate(function (x) { return !x; });\n }, [props.onBlur, setForceUpdate, getImperativeHandle]);\n var onMouseDown = React.useCallback(function (e) {\n if (document && elementRef.current) {\n var activeElement = getActiveElement(document);\n e.preventDefault();\n if (activeElement !== elementRef.current) {\n elementRef.current.focus();\n }\n }\n }, []);\n React.useLayoutEffect(function () {\n // The input element's type ('number') does not support selection.\n if (elementRef.current && elementRef.current.type !== 'number' &&\n stateRef.current.selectionStart !== undefined && stateRef.current.selectionEnd !== undefined) {\n elementRef.current.selectionStart = stateRef.current.selectionStart;\n elementRef.current.selectionEnd = stateRef.current.selectionEnd;\n stateRef.current.selectionStart = undefined;\n stateRef.current.selectionEnd = undefined;\n }\n }, [forceUpdate]);\n var isValid = !validityStylesGetter() || validityGetter().valid;\n var numerictextbox = (React.createElement(\"span\", { dir: props.dir, style: !props.label\n ? __assign({ width: props.width }, props.style) : props.style, className: classNames('k-input', 'k-numerictextbox', (_a = {},\n _a[\"k-input-\".concat(kendoThemeMaps.sizeMap[props.size] || props.size)] = props.size,\n _a[\"k-input-\".concat(props.fillMode)] = props.fillMode,\n _a[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[props.rounded] || props.rounded)] = props.rounded,\n _a['k-invalid'] = !isValid,\n _a['k-required'] = props.required,\n _a['k-disabled'] = props.disabled,\n _a), props.className), \"aria-disabled\": props.disabled ? 'true' : undefined },\n React.createElement(Prefix, null),\n React.createElement(\"input\", { role: 'spinbutton', value: looseValue === null ? '' : looseValue, tabIndex: getTabIndex(props.tabIndex, props.disabled), accessKey: props.accessKey, disabled: props.disabled, title: props.title, \"aria-disabled\": props.disabled ? 'true' : undefined, \"aria-valuemin\": props.min, \"aria-valuemax\": props.max, \"aria-label\": props.ariaLabel, \"aria-labelledby\": props.ariaLabelledBy, \"aria-describedby\": props.ariaDescribedBy, placeholder: props.placeholder, spellCheck: false, autoComplete: 'off', autoCorrect: 'off', type: props.inputType || 'tel', className: 'k-input-inner', id: inputId, name: props.name, readOnly: props.readOnly, style: props.inputStyle, onChange: onChangeHandler, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onPaste: onPasteHandler, onWheel: onWheelHandler, ref: elementRef }),\n React.createElement(Suffix, null),\n props.children,\n props.spinners &&\n (React.createElement(\"span\", { className: \"k-input-spinner k-spin-button\", onMouseDown: onMouseDown },\n React.createElement(Button, { tabIndex: -1, type: \"button\", icon: 'caret-alt-up', svgIcon: caretAltUpIcon, rounded: null, className: \"k-spinner-increase\", \"aria-label\": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), onClick: onIncrease }),\n React.createElement(Button, { tabIndex: -1, type: \"button\", icon: 'caret-alt-down', svgIcon: caretAltDownIcon, rounded: null, className: \"k-spinner-decrease\", \"aria-label\": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), onClick: onDecrease })))));\n return props.label\n ? (React.createElement(FloatingLabel, { label: props.label, editorId: inputId, editorValue: looseValue === null ? '' : looseValue, editorValid: isValid, editorDisabled: props.disabled, editorPlaceholder: props.placeholder, children: numerictextbox, style: { width: props.width }, dir: props.dir }))\n : numerictextbox;\n});\nNumericTextBox.propTypes = {\n value: PropTypes.number,\n defaultValue: PropTypes.number,\n step: PropTypes.number,\n format: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n style: PropTypes.oneOf(['decimal', 'currency', 'percent', 'scientific', 'accounting']),\n currency: PropTypes.string,\n currencyDisplay: PropTypes.oneOf(['symbol', 'code', 'name']),\n useGrouping: PropTypes.bool,\n minimumIntegerDigits: PropTypes.number,\n minimumFractionDigits: PropTypes.number,\n maximumFractionDigits: PropTypes.number\n })\n ]),\n width: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n tabIndex: PropTypes.number,\n accessKey: PropTypes.string,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n min: PropTypes.number,\n max: PropTypes.number,\n spinners: PropTypes.bool,\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool,\n dir: PropTypes.string,\n name: PropTypes.string,\n label: PropTypes.string,\n validationMessage: PropTypes.string,\n required: PropTypes.bool,\n id: PropTypes.string,\n rangeOnEnter: PropTypes.bool,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n ariaLabel: PropTypes.string,\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])\n};\nNumericTextBox.displayName = 'KendoNumericTextBox';\nNumericTextBox.defaultProps = {\n prefix: function (_) { return null; },\n suffix: function (_) { return null; },\n step: 1,\n spinners: true,\n disabled: false,\n required: false,\n validityStyles: true,\n rangeOnEnter: true,\n onChange: function (_) { return; },\n onFocus: function (_) { return; },\n onBlur: function (_) { return; },\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid'\n};\n","import * as React from 'react';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { xIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nexport var DialogTitleBar = function (_a) {\n var children = _a.children, onCloseButtonClick = _a.onCloseButtonClick, id = _a.id, closeIcon = _a.closeIcon;\n return (React.createElement(\"div\", { className: \"k-window-titlebar k-dialog-titlebar\", id: id },\n React.createElement(\"span\", { className: \"k-window-title k-dialog-title\" }, children),\n React.createElement(\"div\", { className: \"k-window-titlebar-actions k-dialog-titlebar-actions\" }, closeIcon &&\n React.createElement(Button, { role: \"button\", \"aria-label\": \"Close\", onClick: onCloseButtonClick, icon: \"x\", svgIcon: xIcon, fillMode: \"flat\", className: \"k-window-titlebar-action k-dialog-titlebar-action\" }))));\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * Returns the action bar of the Dialog.\n *\n * @returns React.ReactElement\n */\nexport var DialogActionsBar = function (props) {\n var _a;\n var _b = props.layout, layout = _b === void 0 ? defaultProps.layout : _b, children = props.children;\n var wrapperClasses = classNames('k-actions', 'k-actions-horizontal', 'k-window-actions k-dialog-actions', (_a = {},\n _a[\"k-actions-\".concat(layout)] = layout,\n _a));\n return (React.createElement(\"div\", { className: wrapperClasses }, children));\n};\nDialogActionsBar.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.oneOf(['start', 'center', 'end', 'stretched'])\n};\nvar defaultProps = {\n layout: 'stretched'\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-dialogs',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801467,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","/** @hidden */\nexport var DATA_DIALOGS_ID = 'data-windowid';\n/** @hidden */\nexport var DEFAULT_DIALOGS_ZINDEX = 10002;\n/** @hidden */\nexport var ZINDEX_DIALOGS_STEP = 2;\n/** @hidden */\nexport var DIALOGS_SELECTOR = '.k-window:not(.k-dialog), .k-dialog-wrapper';\n","import { DATA_DIALOGS_ID, DIALOGS_SELECTOR, ZINDEX_DIALOGS_STEP } from './constants';\n/** @hidden */\nexport var getMaxZIndex = function (currentZIndex, currentDocument, currentWindowId) {\n var maxZindex = currentZIndex;\n if (currentDocument && currentDocument.defaultView) {\n var allWindows = currentDocument.querySelectorAll(DIALOGS_SELECTOR);\n var zIndexChanged_1 = false;\n allWindows.forEach(function (KRwindow) {\n var computedStyle = currentDocument.defaultView.getComputedStyle(KRwindow, null);\n var dataId = KRwindow.getAttribute(DATA_DIALOGS_ID);\n if (dataId !== currentWindowId && computedStyle.zIndex !== null) {\n var zIndexValue = parseInt(computedStyle.zIndex, 10);\n if (zIndexValue >= maxZindex) {\n maxZindex = zIndexValue;\n zIndexChanged_1 = true;\n }\n }\n });\n return zIndexChanged_1 ? (maxZindex + ZINDEX_DIALOGS_STEP) : maxZindex;\n }\n return maxZindex;\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport * as PropTypes from 'prop-types';\nimport { DialogTitleBar } from './DialogTitleBar';\nimport { DialogActionsBar } from './DialogActionsBar';\nimport { guid, dispatchEvent, Keys, canUseDOM, ZIndexContext, createPropsContext, withPropsContext, classNames, getActiveElement } from '@progress/kendo-react-common';\nimport { validatePackage, shouldShowValidationUI, WatermarkOverlay } from '@progress/kendo-react-common';\nimport { packageMetadata } from './package-metadata';\nimport { getMaxZIndex } from './utils';\nimport { DATA_DIALOGS_ID, DEFAULT_DIALOGS_ZINDEX, ZINDEX_DIALOGS_STEP } from './constants';\n// tslint:enable:max-line-length\n/** @hidden */\nvar DialogWithoutContext = /** @class */ (function (_super) {\n __extends(DialogWithoutContext, _super);\n function DialogWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /**\n * @hidden\n */\n _this.context = 0;\n _this._id = guid();\n _this.titleId = _this.generateTitleId();\n _this.contentId = _this.generateContentId();\n _this.showLicenseWatermark = false;\n /**\n * @hidden\n */\n _this.onCloseDialog = function (event) {\n event.preventDefault();\n dispatchEvent(_this.props.onClose, event, _this, undefined);\n };\n /**\n * @hidden\n */\n _this.onKeyDown = function (event) {\n if (event.keyCode === Keys.esc && _this.props.onClose) {\n event.preventDefault();\n _this.onCloseDialog(event);\n }\n var kDialog = _this.element;\n if (kDialog && (event.keyCode === Keys.tab)) {\n var focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n var focusableContent = kDialog.querySelectorAll(focusableElements);\n var firstFocusableElement = focusableContent[0];\n var lastFocusableElement = focusableContent[focusableContent.length - 1];\n var currentDocument = _this.getDocument();\n var activeElement = getActiveElement(currentDocument);\n if (event.shiftKey) {\n if ((currentDocument && activeElement === firstFocusableElement) ||\n currentDocument && activeElement === _this.element) {\n lastFocusableElement.focus();\n event.preventDefault();\n }\n }\n else {\n if (currentDocument && activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n event.preventDefault();\n }\n }\n }\n };\n _this.getCurrentZIndex = function () {\n if (!_this.state || _this.context === undefined) {\n return _this.context ? _this.context : DEFAULT_DIALOGS_ZINDEX;\n }\n return _this.state.zIndex > (_this.context ? _this.context + ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + ZINDEX_DIALOGS_STEP;\n };\n _this.getDocument = function () {\n return _this.props.appendTo ? _this.props.appendTo.ownerDocument : document;\n };\n validatePackage(packageMetadata);\n _this.showLicenseWatermark = shouldShowValidationUI(packageMetadata);\n _this.state = {\n zIndex: getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)\n };\n return _this;\n }\n /**\n * @hidden\n */\n DialogWithoutContext.prototype.componentDidMount = function () {\n if (this.element) {\n if (this.props.autoFocus) {\n this.element.focus();\n }\n }\n };\n /**\n * @hidden\n */\n DialogWithoutContext.prototype.render = function () {\n var _a, _b;\n var _this = this;\n var id = this.props.id !== undefined ? this.props.id : this.titleId;\n var _c = this.props, title = _c.title, width = _c.width, height = _c.height, children = _c.children, minWidth = _c.minWidth, dir = _c.dir, style = _c.style, contentStyle = _c.contentStyle;\n var elementsArray = React.Children.toArray(children);\n var content = this.getContent(elementsArray);\n var actions = this.getActionBar(elementsArray);\n var aria = title ? {\n 'aria-labelledby': id\n } : null;\n var closeIcon = this.props.closeIcon !== undefined ? this.props.closeIcon : true;\n var currentZIndex = this.getCurrentZIndex();\n var dialogElement = (React.createElement(ZIndexContext.Provider, { value: currentZIndex },\n React.createElement(\"div\", __assign({}, (_a = {}, _a[DATA_DIALOGS_ID] = this._id, _a), { className: 'k-dialog-wrapper' + (this.props.className ? ' ' + this.props.className : ''), onKeyDown: this.onKeyDown, tabIndex: 0, dir: dir, style: __assign({ zIndex: currentZIndex }, style), ref: (function (el) { return _this.element = el; }) }),\n React.createElement(\"div\", { className: \"k-overlay\" }),\n React.createElement(\"div\", __assign({}, aria, { className: classNames('k-window k-dialog', (_b = {},\n _b[\"k-window-\".concat(this.props.themeColor)] = this.props.themeColor,\n _b)), role: \"dialog\", \"aria-labelledby\": id, \"aria-modal\": true, \"aria-describedby\": this.contentId, style: { width: width, height: height, minWidth: minWidth } }),\n this.props.title &&\n React.createElement(DialogTitleBar, { closeIcon: closeIcon, onCloseButtonClick: this.onCloseDialog, id: id }, title),\n React.createElement(\"div\", { className: \"k-window-content k-dialog-content\", style: contentStyle, id: this.contentId }, content),\n actions,\n this.showLicenseWatermark && React.createElement(WatermarkOverlay, null)))));\n if (canUseDOM) {\n return this.props.appendTo !== null ?\n ReactDOM.createPortal(dialogElement, this.props.appendTo || document.body) :\n dialogElement;\n }\n return null;\n };\n DialogWithoutContext.prototype.getActionBar = function (children) {\n return children.filter(function (child) { return child && child.type === DialogActionsBar; });\n };\n DialogWithoutContext.prototype.getContent = function (children) {\n return children.filter(function (child) {\n return child && child.type !== DialogActionsBar;\n });\n };\n DialogWithoutContext.prototype.generateTitleId = function () {\n return 'dialog-title' + this._id;\n };\n DialogWithoutContext.prototype.generateContentId = function () {\n return 'dialog-content' + this._id;\n };\n DialogWithoutContext.displayName = 'Dialog';\n /**\n * @hidden\n */\n DialogWithoutContext.propTypes = {\n title: PropTypes.any,\n id: PropTypes.string,\n dir: PropTypes.string,\n style: PropTypes.object,\n closeIcon: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n autoFocus: PropTypes.bool\n };\n /**\n * @hidden\n */\n DialogWithoutContext.defaultProps = {\n autoFocus: false\n };\n /**\n * @hidden\n */\n DialogWithoutContext.contextType = ZIndexContext;\n return DialogWithoutContext;\n}(React.Component));\n/**\n * Represents the PropsContext of the `Dialog` component.\n * Used for global configuration of all `Dialog` instances.\n */\nexport var DialogPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the [KendoReact Dialog component]({% slug overview_dialog %}).\n *\n * Accepts properties of type [DialogProps]({% slug api_dialogs_dialogprops %}).\n * Obtaining the `ref` returns an object of type [DialogHandle]({% slug api_dialogs_dialoghandle %}).\n */\nexport var Dialog = withPropsContext(DialogPropsContext, DialogWithoutContext);\nDialog.displayName = 'KendoReactDialog';\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, kendoThemeMaps, useAsyncFocusBlur, useCustomComponent, validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\n;\n/**\n * Represents the [KendoReact TextBox component]({% slug overview_textbox %}).\n */\nexport var TextBox = React.forwardRef(function (props, ref) {\n var _a;\n validatePackage(packageMetadata);\n var element = React.useRef(null);\n var target = React.useRef(null);\n var valueDuringChangeRef = React.useRef();\n var valueGetter = React.useCallback(function () {\n var _a;\n if (valueDuringChangeRef.current !== undefined) {\n return valueDuringChangeRef.current;\n }\n else {\n return (_a = element.current) === null || _a === void 0 ? void 0 : _a.value;\n }\n }, []);\n React.useImperativeHandle(target, function () {\n var result = {\n element: element.current\n };\n Object.defineProperty(result, 'value', { get: valueGetter });\n return result;\n });\n React.useImperativeHandle(ref, function () { return target.current; });\n var _b = props, size = _b.size, fillMode = _b.fillMode, rounded = _b.rounded, className = _b.className, dir = _b.dir, style = _b.style, _c = _b.prefix, prefix = _c === void 0 ? defaultProps.prefix : _c, _d = _b.suffix, suffix = _d === void 0 ? defaultProps.suffix : _d, valid = _b.valid, \n // Destruct to avoid warning when used inside a form field\n _modified = _b.modified, _touched = _b.touched, _visited = _b.visited, other = __rest(_b, [\"size\", \"fillMode\", \"rounded\", \"className\", \"dir\", \"style\", \"prefix\", \"suffix\", \"valid\", \"modified\", \"touched\", \"visited\"]);\n var Prefix = useCustomComponent(prefix)[0];\n var Suffix = useCustomComponent(suffix)[0];\n var _e = React.useState(false), focused = _e[0], setFocused = _e[1];\n var handleFocus = function (_) {\n setFocused(true);\n };\n var handleBlur = function (_) {\n setFocused(false);\n };\n var handleChange = React.useCallback(function (event) {\n valueDuringChangeRef.current = event.target.value;\n if (props.onChange) {\n props.onChange.call(undefined, {\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n value: event.target.value,\n target: target.current\n });\n }\n valueDuringChangeRef.current = undefined;\n }, [props.onChange]);\n var _f = useAsyncFocusBlur({\n onFocus: handleFocus,\n onBlur: handleBlur,\n onSyncFocus: props.onFocus,\n onSyncBlur: props.onBlur\n }), onFocus = _f.onFocus, onBlur = _f.onBlur;\n return (React.createElement(\"span\", { style: style, dir: dir, className: classNames('k-textbox k-input', (_a = {},\n _a[\"k-input-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _a[\"k-input-\".concat(fillMode)] = fillMode,\n _a[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,\n _a), {\n 'k-focus': focused,\n 'k-required': props.required,\n 'k-disabled': props.disabled,\n 'k-invalid': props.valid === false\n }, className), onFocus: onFocus, onBlur: onBlur },\n React.createElement(Prefix, null),\n React.createElement(\"input\", __assign({ ref: element, className: \"k-input-inner\" }, other, { onChange: handleChange })),\n React.createElement(Suffix, null)));\n});\nvar defaultProps = {\n prefix: function (_) { return null; },\n suffix: function (_) { return null; },\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid'\n};\nTextBox.propTypes = {\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])\n};\nTextBox.displayName = 'KendoReactTextBoxComponent';\nTextBox.defaultProps = defaultProps;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { classNames } from '@progress/kendo-react-common';\nimport * as React from 'react';\n/**\n * Represents the KendoReact InputPrefix component.\n */\nexport var InputPrefix = React.forwardRef(function (props, ref) {\n var target = React.useRef(null);\n var element = React.useRef(null);\n React.useImperativeHandle(target, function () { return ({ element: element.current }); });\n React.useImperativeHandle(ref, function () { return target.current; });\n return (React.createElement(\"span\", __assign({}, props, { className: classNames('k-input-prefix', props.className) })));\n});\nInputPrefix.displayName = 'KendoReactInputPrefix';\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { registerForLocalization, provideLocalizationService, provideIntlService } from '@progress/kendo-react-intl';\nimport { messages, pagerOf, pagerPage, pagerTotalPages } from './../messages';\nimport { NumericTextBox } from '@progress/kendo-react-inputs';\n/**\n * @hidden\n */\nvar PagerInput = /** @class */ (function (_super) {\n __extends(PagerInput, _super);\n function PagerInput() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = { page: _this.props.currentPage };\n _this.handleOnChange = function (e) {\n _this.setState({ page: e.target.value });\n if (e.target.value) {\n _this.props.pageChange(e.target.value, e);\n }\n };\n return _this;\n }\n PagerInput.prototype.render = function () {\n var intlService = provideIntlService(this);\n var localizationService = provideLocalizationService(this);\n var pageMessage = this.props.messagesMap ? this.props.messagesMap(pagerPage) :\n ({ messageKey: pagerPage, defaultMessage: messages[pagerPage] });\n var ofMessage = this.props.messagesMap ? this.props.messagesMap(pagerOf) :\n ({ messageKey: pagerOf, defaultMessage: messages[pagerOf] });\n var totalPagesMessage = this.props.messagesMap ? this.props.messagesMap(pagerTotalPages) :\n ({ messageKey: pagerTotalPages, defaultMessage: messages[pagerTotalPages] });\n return (React.createElement(React.Fragment, null,\n React.createElement(\"span\", { className: \"k-pager-input\" },\n React.createElement(\"span\", null, localizationService.toLanguageString(pageMessage.messageKey, pageMessage.defaultMessage)),\n React.createElement(NumericTextBox, { value: this.props.currentPage !== undefined ? this.props.currentPage : this.state.page, onChange: this.handleOnChange, min: 1, spinners: false }),\n React.createElement(\"span\", null, \"\".concat(localizationService.toLanguageString(ofMessage.messageKey, ofMessage.defaultMessage), \" \").concat(intlService\n .format(localizationService.toLanguageString(totalPagesMessage.messageKey, totalPagesMessage.defaultMessage), [\n this.props.totalPages\n ]))))));\n };\n return PagerInput;\n}(React.Component));\nexport { PagerInput };\nregisterForLocalization(PagerInput);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { Popup } from '@progress/kendo-react-popup';\n/**\n * @hidden\n */\nvar ListContainer = /** @class */ (function (_super) {\n __extends(ListContainer, _super);\n function ListContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ListContainer.prototype.render = function () {\n var _a = this.props, children = _a.children, width = _a.width, dir = _a.dir, itemsCount = _a.itemsCount, popupSettings = _a.popupSettings;\n return (React.createElement(Popup, __assign({ style: { width: width, direction: dir }, contentKey: itemsCount && itemsCount.join() }, popupSettings), children));\n };\n return ListContainer;\n}(React.Component));\nexport default ListContainer;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { TextBox, InputPrefix } from '@progress/kendo-react-inputs';\nimport { searchIcon } from '@progress/kendo-svg-icons';\nimport { IconWrap } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar ListFilter = React.forwardRef(function (props, ref) {\n var input = React.useRef(null);\n React.useImperativeHandle(ref, function () { return input.current; });\n return (React.createElement(\"div\", { className: \"k-list-filter\" },\n React.createElement(TextBox, __assign({}, props, { ref: input, value: props.value || '', onChange: props.onChange, onKeyDown: props.onKeyDown, tabIndex: props.tabIndex, onClick: function (e) { return e.stopPropagation(); }, size: props.size, fillMode: props.fillMode, rounded: props.rounded, prefix: function () { return (React.createElement(InputPrefix, null,\n React.createElement(IconWrap, { name: 'search', icon: searchIcon }))); } }))));\n});\nListFilter.propTypes = {\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\n tabIndex: PropTypes.number,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])\n};\nListFilter.displayName = 'KendoReactListFilter';\nexport default ListFilter;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\n/**\n * @hidden\n */\nvar GroupStickyHeader = /** @class */ (function (_super) {\n __extends(GroupStickyHeader, _super);\n function GroupStickyHeader() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GroupStickyHeader.prototype.render = function () {\n var _a = this.props, group = _a.group, groupMode = _a.groupMode, renderer = _a.render;\n var item = (React.createElement(\"div\", { className: \"k-list-group-sticky-header\" }, groupMode === 'classic'\n ? group\n : React.createElement(\"div\", { className: \"k-list-header-text\" }, group)));\n return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;\n };\n return GroupStickyHeader;\n}(React.Component));\nexport default GroupStickyHeader;\n","/**\n * @hidden\n */\nvar isPresent = function (value) { return value !== null && value !== undefined; };\n/**\n * @hidden\n */\nvar sameCharsOnly = function (word, character) {\n for (var idx = 0; idx < word.length; idx++) {\n if (word.charAt(idx) !== character) {\n return false;\n }\n }\n return true;\n};\n/**\n * @hidden\n */\nvar shuffleData = function (data, splitIndex, defaultItem) {\n var result = data;\n if (defaultItem) {\n result = [defaultItem].concat(result);\n }\n return result.slice(splitIndex).concat(result.slice(0, splitIndex));\n};\n/**\n * @hidden\n */\nvar matchText = function (text, word, ignoreCase) {\n if (!isPresent(text)) {\n return false;\n }\n var temp = String(text);\n if (ignoreCase) {\n temp = temp.toLowerCase();\n }\n return temp.indexOf(word) === 0;\n};\n/**\n * @hidden\n */\nvar scrollToItem = function (scrollElem, list, itemIndex, translate, virtualScroll) {\n var viewportHeight = scrollElem.offsetHeight;\n var li = list.children.item(itemIndex);\n var itemOffsetTop = li.offsetTop + (virtualScroll ? translate - scrollElem.scrollTop : 0);\n var itemHeight = li.offsetHeight;\n if (virtualScroll) {\n var diff = 0;\n if (itemOffsetTop + itemHeight > viewportHeight) {\n diff = itemOffsetTop + itemHeight - viewportHeight;\n }\n else if (itemOffsetTop < 0) {\n diff = itemOffsetTop;\n }\n if (diff !== 0) {\n scrollElem.scrollTop += diff;\n }\n else if (scrollElem.scrollTop === 0 && translate !== 0) {\n scrollElem.scrollTop = translate;\n }\n }\n else {\n if (itemOffsetTop + itemHeight > viewportHeight + scrollElem.scrollTop) {\n scrollElem.scrollTop = (itemOffsetTop + itemHeight - viewportHeight);\n }\n else if (itemOffsetTop < scrollElem.scrollTop) {\n scrollElem.scrollTop -= scrollElem.scrollTop - itemOffsetTop;\n }\n }\n};\n/**\n * @hidden\n */\nvar itemIndexStartsWith = function (items, text, field) {\n var result = -1;\n if (text) {\n text = text.toLowerCase();\n for (var i = 0; i < items.length; i++) {\n var itemText = (getItemValue(items[i], field) || '') + '';\n if (itemText && itemText.toLowerCase().startsWith(text)) {\n result = i;\n break;\n }\n }\n }\n return result;\n};\n/**\n * @hidden\n */\nvar getItemIndexByText = function (data, text, textField, matchCase) {\n if (matchCase === void 0) { matchCase = false; }\n var casing = function (value) { return matchCase ? value : value.toLowerCase(); };\n return data.findIndex(function (item) {\n return textField ? casing(getItemValue(item, textField)) === casing(text) :\n casing(text) === casing(item.toString());\n });\n};\n/**\n * @hidden\n */\nvar getItemValue = function (item, field) {\n if (field && isPresent(item)) {\n var path = field.split('.');\n var data_1 = item;\n path.forEach(function (p) {\n data_1 = data_1 ? data_1[p] : undefined;\n });\n return data_1;\n }\n return item;\n};\n/**\n * @hidden\n */\nvar matchDataCollections = function (data1, data2, key) {\n if (data1 === void 0) { data1 = []; }\n if (data2 === void 0) { data2 = []; }\n if (data1 === data2) {\n return true;\n }\n if (data1.length !== data2.length) {\n return false;\n }\n for (var i = 0; i < data1.length; i++) {\n if (!areSame(data1[i], data2[i], key)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @hidden\n */\nvar removeDataItems = function (items, toRemove, key) {\n toRemove.forEach(function (item) {\n var itemIndex = items.findIndex(function (i) { return areSame(i, item, key); });\n if (itemIndex !== -1) {\n items.splice(itemIndex, 1);\n }\n });\n};\n/**\n * @hidden\n */\nvar areSame = function (item1, item2, key) {\n return item1 === item2 ||\n (isPresent(item1) === isPresent(item2) && getItemValue(item1, key) === getItemValue(item2, key));\n};\n/**\n * @hidden\n */\nvar getFocusedItem = function (data, value, textField) {\n if (value) {\n var selectedIndex = getItemIndexByText(data, value, textField, true);\n return selectedIndex !== -1 ? data[selectedIndex] : data[itemIndexStartsWith(data, value, textField)];\n }\n return data[0];\n};\n/**\n * @hidden\n */\nvar suggestValue = function (value, data, textField) {\n if (data === void 0) { data = []; }\n var suggested = '';\n if (value) {\n var suggestedItem = data[itemIndexStartsWith(data, value, textField)];\n if (suggestedItem) {\n var suggestedText = getItemValue(suggestedItem, textField);\n if (value.toLowerCase() !== suggestedText.toLowerCase()) {\n suggested = suggestedText.substring(value.length);\n }\n }\n }\n return suggested;\n};\n/**\n * @hidden\n */\nvar preventDefaultNonInputs = function (event) {\n if (event.target.nodeName !== 'INPUT') {\n event.preventDefault();\n }\n};\n/**\n * @hidden\n */\nvar matchTags = function (tag1, tag2, key) {\n if (!!tag1 !== !!tag2 || tag1.text !== tag2.text) {\n return false;\n }\n return tag1 === tag2 || matchDataCollections(tag1.data, tag2.data, key);\n};\nexport { isPresent, sameCharsOnly, shuffleData, matchText, scrollToItem, itemIndexStartsWith, getItemIndexByText, getItemValue, matchDataCollections, removeDataItems, areSame, getFocusedItem, preventDefaultNonInputs, suggestValue, matchTags };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\nimport { getItemValue } from './utils';\nvar preventDefault = function (e) { return e.preventDefault(); };\n/**\n * @hidden\n */\nvar ListDefaultItem = /** @class */ (function (_super) {\n __extends(ListDefaultItem, _super);\n function ListDefaultItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ListDefaultItem.prototype.render = function () {\n var _a = this.props, selected = _a.selected, defaultItem = _a.defaultItem, textField = _a.textField;\n return (React.createElement(\"div\", { onClick: this.props.onClick, onMouseDown: preventDefault, style: { position: 'unset' }, className: classNames('k-list-optionlabel', {\n 'k-selected': selected\n }) }, getItemValue(defaultItem, textField) || ''));\n };\n return ListDefaultItem;\n}(React.Component));\nexport default ListDefaultItem;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\nimport { getItemValue } from './utils';\n// tslint:enable:max-line-length\n/**\n * @hidden\n */\nvar ListItem = /** @class */ (function (_super) {\n __extends(ListItem, _super);\n function ListItem() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleClick = function (e) { return _this.props.onClick(_this.props.index, e); };\n return _this;\n }\n ListItem.prototype.render = function () {\n var _a = this.props, selected = _a.selected, group = _a.group, dataItem = _a.dataItem, virtual = _a.virtual, groupMode = _a.groupMode, disabled = _a.disabled, renderer = _a.render;\n var item = (React.createElement(\"li\", { id: this.props.id, role: \"option\", \"aria-selected\": selected, \"aria-disabled\": disabled ? true : undefined, className: classNames('k-list-item', {\n 'k-selected': selected,\n 'k-focus': this.props.focused,\n 'k-first': Boolean(group) && groupMode === 'classic',\n 'k-disabled': disabled\n }), onClick: this.handleClick, style: { position: virtual ? 'relative' : 'unset' } },\n React.createElement(\"span\", { className: 'k-list-item-text' }, getItemValue(dataItem, this.props.textField).toString()),\n group !== undefined && groupMode === 'classic' ? React.createElement(\"div\", { className: \"k-list-item-group-label\" }, group) : null));\n return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;\n };\n return ListItem;\n}(React.Component));\nexport default ListItem;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\n/**\n * @hidden\n */\nvar ListGroupItem = /** @class */ (function (_super) {\n __extends(ListGroupItem, _super);\n function ListGroupItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ListGroupItem.prototype.render = function () {\n var _a = this.props, group = _a.group, virtual = _a.virtual, renderer = _a.render, _b = _a.isMultiColumn, isMultiColumn = _b === void 0 ? false : _b;\n var item = (React.createElement(\"li\", { id: this.props.id, role: \"group\", className: isMultiColumn ? 'k-table-group-row' : 'k-list-group-item', style: isMultiColumn ? { 'boxSizing': 'inherit' } : { position: virtual ? 'relative' : 'unset' } },\n React.createElement(\"span\", { className: !renderer ? isMultiColumn ? 'k-table-th' : 'k-list-item-text' : undefined }, group)));\n return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;\n };\n return ListGroupItem;\n}(React.Component));\nexport default ListGroupItem;\n","var _a;\n/**\n * @hidden\n */\nexport var nodata = 'dropdowns.nodata';\n/**\n * @hidden\n */\nexport var clear = 'dropdowns.clear';\n/**\n * @hidden\n */\nexport var comboArrowBtnAriaLabelExpand = 'dropdowns.comboArrowBtnAriaLabelExpand';\n/**\n * @hidden\n */\nexport var comboArrowBtnAriaLabelCollapse = 'dropdowns.comboArrowBtnAriaLabelCollapse';\n/**\n * @hidden\n */\nexport var dropDownListArrowBtnAriaLabel = 'dropdowns.dropDownListArrowBtnAriaLabel';\n/**\n * @hidden\n */\nexport var adaptiveModeFooterApply = 'dropdowns.apply';\n/**\n * @hidden\n */\nexport var adaptiveModeFooterCancel = 'dropdowns.cancel';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[clear] = 'clear',\n _a[nodata] = 'NO DATA FOUND.',\n _a[comboArrowBtnAriaLabelExpand] = 'expand combobox',\n _a[comboArrowBtnAriaLabelCollapse] = 'collapse combobox',\n _a[dropDownListArrowBtnAriaLabel] = 'select',\n _a[adaptiveModeFooterApply] = 'Apply',\n _a[adaptiveModeFooterCancel] = 'Cancel',\n _a);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport ListItem from './ListItem';\nimport ListGroupItem from './ListGroupItem';\nimport { areSame, getItemValue } from './utils';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { messages, nodata } from '../messages';\n/**\n * @hidden\n */\nvar List = /** @class */ (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n List.prototype.renderItems = function () {\n var _this = this;\n var _a = this.props, textField = _a.textField, valueField = _a.valueField, groupField = _a.groupField, groupMode = _a.groupMode, isMultiColumn = _a.isMultiColumn, optionsGuid = _a.optionsGuid, _b = _a.skip, skip = _b === void 0 ? 0 : _b, virtual = _a.virtual, focusedIndex = _a.focusedIndex, _c = _a.highlightSelected, highlightSelected = _c === void 0 ? true : _c, value = _a.value, data = _a.data, itemRender = _a.itemRender, groupHeaderItemRender = _a.groupHeaderItemRender;\n var isArray = Array.isArray(value);\n var groupCounter = 0;\n return data.map(function (item, index) {\n var realIndex = skip + index;\n var idIndex = skip + index + groupCounter;\n var selected = item.disabled ? false : highlightSelected &&\n ((!isArray && areSame(item, value, valueField)) ||\n (isArray && value.findIndex(function (i) { return areSame(i, item, valueField); }) !== -1));\n var group = undefined;\n var current, previous;\n if (index > 0 && groupField !== undefined) {\n current = getItemValue(item, groupField);\n previous = getItemValue(data[index - 1], groupField);\n if (current && previous && current !== previous) {\n group = current;\n }\n }\n group !== undefined && groupMode === 'modern' ? groupCounter += 1 : '';\n return [\n group !== undefined && groupMode === 'modern' && React.createElement(ListGroupItem, { id: \"option-\".concat(optionsGuid, \"-\").concat(idIndex), virtual: virtual, key: realIndex + '-group-item', group: group, isMultiColumn: isMultiColumn, render: groupHeaderItemRender }),\n React.createElement(ListItem, { id: \"option-\".concat(optionsGuid, \"-\").concat(group !== undefined && groupMode === 'modern' ? idIndex + 1 : idIndex), virtual: virtual, dataItem: item, groupMode: groupMode, selected: selected, focused: focusedIndex === index, index: realIndex, key: realIndex, onClick: _this.props.onClick, textField: textField, group: group, render: itemRender, disabled: item.disabled })\n ];\n });\n };\n List.prototype.renderNoValueElement = function (localizationService) {\n var noDataRender = this.props.noDataRender;\n var noDataElement = (React.createElement(\"div\", { className: 'k-nodata' },\n React.createElement(\"div\", null, localizationService.toLanguageString(nodata, messages[nodata]))));\n return noDataRender ?\n noDataRender.call(undefined, noDataElement) : noDataElement;\n };\n List.prototype.render = function () {\n var localizationService = provideLocalizationService(this);\n var _a = this.props, id = _a.id, show = _a.show, wrapperCssClass = _a.wrapperCssClass, wrapperStyle = _a.wrapperStyle, listStyle = _a.listStyle, listRef = _a.listRef, wrapperRef = _a.wrapperRef, _b = _a.listClassName, listClassName = _b === void 0 ? 'k-list-ul' : _b;\n var items = this.renderItems();\n return (items.length ? (React.createElement(\"div\", { className: wrapperCssClass, style: wrapperStyle, ref: wrapperRef, onMouseDown: this.props.onMouseDown, onBlur: this.props.onBlur, onScroll: this.props.onScroll, unselectable: \"on\" },\n React.createElement(\"ul\", { id: id, role: \"listbox\", \"aria-hidden\": !show ? true : undefined, className: listClassName, ref: listRef, style: listStyle }, items),\n this.props.scroller && React.createElement(\"div\", { className: \"k-height-container\" }, this.props.scroller))) : this.renderNoValueElement(localizationService));\n };\n return List;\n}(React.Component));\nexport default List;\nregisterForLocalization(List);\n","var maxHeightIE = 1533915;\n/**\n * @hidden\n */\nvar VirtualScroll = /** @class */ (function () {\n function VirtualScroll() {\n var _this = this;\n this.container = null;\n this.scrollElement = null;\n this.list = null;\n this.containerHeight = 0;\n this.skip = 0;\n this.total = 0;\n this.enabled = false;\n this.pageSize = 0;\n this.itemHeight = 0;\n this.PageChange = null;\n this.prevScrollPos = 0;\n this.listTranslate = 0;\n this.scrollSyncing = false;\n this.scrollerRef = function (element) {\n var vs = _this;\n vs.container = element;\n if (element) {\n element.setAttribute('unselectable', 'on');\n window.setTimeout(vs.calcScrollElementHeight.bind(vs), 0);\n }\n };\n this.calcScrollElementHeight = function () {\n _this.scrollSyncing = true;\n var heightChanged = false;\n _this.itemHeight = _this.list ? _this.list.children[0].offsetHeight : _this.itemHeight;\n _this.containerHeight = Math.min(maxHeightIE, _this.itemHeight * _this.total);\n var newHeight = _this.containerHeight;\n if (_this.scrollElement) {\n heightChanged = _this.scrollElement.style.height !== newHeight + 'px';\n if (heightChanged) {\n _this.scrollElement.style.height = newHeight + 'px';\n }\n }\n _this.scrollSyncing = false;\n return heightChanged;\n };\n this.scrollHandler = this.scrollHandler.bind(this);\n }\n Object.defineProperty(VirtualScroll.prototype, \"translate\", {\n get: function () {\n return this.listTranslate;\n },\n enumerable: false,\n configurable: true\n });\n VirtualScroll.prototype.changePage = function (skip, e) {\n var newSkip = Math.min(Math.max(0, skip), this.total - this.pageSize);\n if (newSkip !== this.skip && this.PageChange) {\n this.PageChange({ skip: newSkip, take: this.pageSize }, e);\n }\n };\n VirtualScroll.prototype.translateTo = function (dY) {\n this.listTranslate = dY;\n if (this.list) {\n this.list.style.transform = 'translateY(' + dY + 'px)';\n }\n };\n VirtualScroll.prototype.reset = function () {\n if (this.container) {\n this.calcScrollElementHeight();\n this.container.scrollTop = 0;\n this.translateTo(0);\n }\n };\n VirtualScroll.prototype.scrollToEnd = function () {\n if (this.container && this.list) {\n this.calcScrollElementHeight();\n this.container.scrollTop = this.container.scrollHeight - this.container.offsetHeight;\n this.translateTo(this.container.scrollHeight); // - this.list.offsetHeight\n }\n };\n VirtualScroll.prototype.localScrollUp = function (e) {\n var height = this.itemHeight;\n var scrollTop = this.container.scrollTop;\n var targetTranslate = this.listTranslate;\n var items;\n var additionalOnTop = scrollTop - targetTranslate;\n if (additionalOnTop > height) {\n return;\n }\n for (items = 0; items < this.skip; items++) {\n if (targetTranslate + height + additionalOnTop <= scrollTop) {\n break;\n }\n targetTranslate -= height;\n }\n targetTranslate = this.validateTranslate(targetTranslate);\n if (this.skip - items <= 0 && targetTranslate >= scrollTop) {\n this.translateTo(0);\n this.changePage(0, e);\n this.container.scrollTop = 0;\n return;\n }\n if (targetTranslate !== this.listTranslate) {\n this.translateTo(targetTranslate);\n this.changePage(this.skip - items, e);\n }\n };\n VirtualScroll.prototype.localScrollDown = function (e) {\n var height = this.itemHeight;\n var scrollTop = this.container.scrollTop;\n var targetTranslate = this.listTranslate;\n var itemsLenght = this.list.children.length;\n var items;\n for (items = 0; items < itemsLenght; items++) {\n if (targetTranslate + height >= scrollTop) {\n break;\n }\n targetTranslate += height;\n }\n targetTranslate = this.validateTranslate(targetTranslate);\n if (items >= itemsLenght && this.skip + items >= this.total) {\n this.translateTo(targetTranslate);\n this.changePage(this.total - 1, e);\n }\n else if (targetTranslate !== this.listTranslate) {\n this.translateTo(targetTranslate);\n this.changePage(this.skip + items, e);\n }\n };\n VirtualScroll.prototype.scrollNonStrict = function (e) {\n var floatItemIndex = this.total * this.prevScrollPos / (this.containerHeight);\n var itemIndex = Math.min(Math.floor(floatItemIndex), this.total - 1);\n var targetTranslate = this.containerHeight * floatItemIndex / this.total;\n targetTranslate = this.validateTranslate(targetTranslate);\n this.translateTo(targetTranslate);\n this.changePage(itemIndex, e);\n };\n VirtualScroll.prototype.scrollHandler = function (e) {\n var scrollTop = this.container ? this.container.scrollTop : 0;\n var prev = this.prevScrollPos;\n this.prevScrollPos = scrollTop;\n if (!this.enabled || !this.list || !this.container || this.scrollSyncing) {\n return;\n }\n if (scrollTop - prev <= 0 && scrollTop > this.listTranslate - this.list.scrollHeight / 10) {\n this.localScrollUp(e);\n }\n else if (scrollTop - prev > 0 && scrollTop < this.listTranslate + this.list.scrollHeight * 2 / 3) {\n this.localScrollDown(e);\n }\n else {\n this.scrollNonStrict(e);\n }\n };\n VirtualScroll.prototype.validateTranslate = function (translate) {\n translate = Math.max(0, translate);\n // translate = Math.min(this.containerHeight - this.list!.offsetHeight, translate);\n translate = Math.min(this.containerHeight, translate);\n return translate;\n };\n return VirtualScroll;\n}());\nexport default VirtualScroll;\n","import { isPresent } from './utils';\nimport { Keys } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar Navigation = /** @class */ (function () {\n function Navigation() {\n }\n Navigation.prototype.navigate = function (args) {\n var keyCode = args.keyCode;\n if (keyCode === Keys.up || keyCode === Keys.left) {\n return this.next({ current: args.current, min: args.min, max: args.max, step: args.skipItems ? args.skipItems : -1 });\n }\n else if (keyCode === Keys.down || keyCode === Keys.right) {\n return this.next({ current: args.current, min: args.min, max: args.max, step: args.skipItems ? args.skipItems : 1 });\n }\n else if (keyCode === Keys.home) {\n return 0;\n }\n else if (keyCode === Keys.end) {\n return args.max;\n }\n };\n Navigation.prototype.next = function (args) {\n if (!isPresent(args.current)) {\n return args.min;\n }\n else {\n return Math.min(args.max, Math.max(args.current + args.step, args.min));\n }\n };\n return Navigation;\n}());\nexport { Navigation };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport VirtualScroll from './VirtualScroll';\nimport { Navigation } from './Navigation';\nimport { scrollToItem, areSame } from './utils';\nimport { guid } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar DropDownBase = /** @class */ (function () {\n function DropDownBase(component) {\n var _this = this;\n this.wrapper = null;\n this.list = null;\n this.vs = new VirtualScroll();\n this.navigation = new Navigation();\n this.handleItemClick = function (index, event) {\n var state = _this.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n _this.component.handleItemSelect(index, state);\n _this.togglePopup(state);\n _this.applyState(state);\n };\n this.handleFocus = function (event) {\n if (!_this.component.state.focused) {\n var state = _this.initState();\n state.data.focused = true;\n state.events.push({ type: 'onFocus' });\n state.syntheticEvent = event;\n _this.applyState(state);\n }\n };\n this.filterChanged = function (text, state) {\n var _a = _this.component.props, textField = _a.textField, filterable = _a.filterable;\n if (filterable) {\n state.events.push({\n type: 'onFilterChange',\n filter: {\n field: textField,\n operator: 'contains',\n ignoreCase: true,\n value: text\n }\n });\n }\n };\n this.togglePopup = function (state) {\n var props = _this.component.props;\n var opened = props.opened !== undefined ? props.opened : _this.component.state.opened;\n if (props.opened === undefined) {\n state.data.opened = !opened;\n }\n if (opened) {\n state.events.push({ type: 'onClose' });\n }\n else {\n state.events.push({ type: 'onOpen' });\n _this.calculatePopupWidth();\n }\n };\n this.pageChange = function (page, syntheticEvent) {\n var state = _this.initState();\n state.syntheticEvent = syntheticEvent;\n _this.triggerOnPageChange(state, page.skip, page.take);\n _this.applyState(state);\n };\n this.scrollToVirtualItem = function (virtual, selectedItemIndex) {\n var vs = _this.vs;\n vs.enabled = false;\n if (virtual.skip === 0) {\n vs.reset();\n }\n else if (virtual.skip + virtual.pageSize === virtual.total) {\n vs.scrollToEnd();\n }\n else {\n var scrollTop = vs.translate;\n if (scrollTop === 0) {\n vs.calcScrollElementHeight();\n scrollTop = (vs.itemHeight * virtual.skip);\n vs.translateTo(scrollTop - vs.itemHeight);\n }\n if (vs.container) {\n vs.container.scrollTop = scrollTop;\n }\n _this.scrollToItem(selectedItemIndex, true);\n }\n window.setTimeout(function () { return vs.enabled = true; }, 10);\n };\n /**\n * @hidden\n * Scrolls the data inside the popup of a selected DropDown by `one page`. The page size\n * depends on the height of the popup.\n *\n * @param {number} direction Defines the direction(Up/Down) in which the page will be moved\n * @param {number} filterHeight Defines the heigh of the filter element that appears in the DropDownList and DropDownTree.\n * This property is added for handling the filtering scenarios of the mentioned components.\n */\n this.scrollPopupByPageSize = function (direction) {\n var _a, _b, _c, _d, _e, _f;\n var vs = _this.vs;\n var offsetTop = (_b = (_a = _this.list) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollTop;\n var itemHeight = (vs.enabled && vs.itemHeight ? vs.itemHeight : (_this.list ? _this.list.children[0].offsetHeight : 0));\n var height = (_d = (_c = _this.list) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.offsetHeight;\n if (offsetTop !== undefined && height !== undefined) {\n (_f = (_e = _this.list) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.scroll({ top: offsetTop + direction * Math.floor(height / itemHeight) * itemHeight });\n }\n };\n this.renderScrollElement = function () {\n var vs = _this.vs;\n return vs.enabled && (React.createElement(\"div\", { ref: function (element) { return vs.scrollElement = element; }, key: 'scrollElementKey' }));\n };\n this.resetGroupStickyHeader = function (groupName, that) {\n if (groupName !== that.state.group) {\n that.setState(__assign(__assign({}, that.state), { group: groupName }));\n }\n };\n this.listBoxId = guid();\n this.guid = guid();\n this.component = component;\n this.vs.PageChange = this.pageChange;\n }\n DropDownBase.prototype.didMount = function () {\n var props = this.component.props;\n var popupSettings = props.popupSettings || {};\n var style = props.style || {};\n var popupWidth = popupSettings.width;\n var shouldUpdate = props.opened === true;\n if (popupWidth === undefined) {\n this.calculatePopupWidth();\n }\n if (props.dir === undefined && style.direction === undefined) {\n this.calculateDir();\n shouldUpdate = true;\n }\n if (shouldUpdate) {\n this.component.forceUpdate();\n }\n };\n DropDownBase.prototype.calculateDir = function () {\n var element = this.component.element;\n if (element && element.ownerDocument && element.ownerDocument.defaultView) {\n this.dirCalculated = element.ownerDocument.defaultView.getComputedStyle(element).direction || undefined;\n }\n };\n DropDownBase.prototype.calculatePopupWidth = function () {\n if (this.wrapper) {\n this.popupWidth = this.wrapper.offsetWidth + 'px';\n }\n };\n DropDownBase.prototype.scrollToItem = function (itemIndex, vsEnabled, once) {\n var _this = this;\n var list = this.list || this.vs.list;\n if (!list && !once) {\n setTimeout(function () {\n _this.scrollToItem(itemIndex, vsEnabled, true);\n }, 10);\n }\n if (list && itemIndex >= 0) {\n var vs = this.vs;\n var scrollElement = (vs.container || list.parentNode);\n var virtualScroll = vsEnabled !== undefined ? vsEnabled : vs.enabled;\n scrollToItem(scrollElement, list, itemIndex, vs.translate, virtualScroll);\n }\n };\n DropDownBase.prototype.initState = function () {\n var state = {\n data: {},\n events: [],\n syntheticEvent: undefined\n };\n return state;\n };\n DropDownBase.prototype.applyState = function (state) {\n var _this = this;\n if (Object.keys(state.data).length > 0) {\n this.component.setState(state.data);\n }\n var eventArgs = {\n syntheticEvent: state.syntheticEvent,\n nativeEvent: state.syntheticEvent ? state.syntheticEvent.nativeEvent : undefined,\n target: this.component,\n value: this.component.value\n };\n state.events.forEach(function (eventData) {\n var type = eventData.type;\n delete eventData.type;\n var handler = type && _this.component.props[type];\n if (handler) {\n handler.call(undefined, __assign(__assign({}, eventArgs), eventData));\n }\n });\n };\n DropDownBase.prototype.triggerOnPageChange = function (state, skip, take) {\n var virtual = this.component.props.virtual;\n if (virtual) {\n var newSkip = Math.min(Math.max(0, skip), Math.max(0, virtual.total - take));\n if (newSkip !== virtual.skip) {\n state.events.push({\n type: 'onPageChange',\n page: { skip: newSkip, take: take }\n });\n }\n }\n };\n DropDownBase.prototype.triggerPageChangeCornerItems = function (item, state) {\n var props = this.component.props;\n var _a = props.data, data = _a === void 0 ? [] : _a, dataItemKey = props.dataItemKey, virtual = props.virtual;\n var opened = props.opened !== undefined ? props.opened : this.component.state.opened;\n if (item && virtual && this.vs.enabled) {\n if (virtual.skip > 0 && areSame(item, data[0], dataItemKey)) {\n this.triggerOnPageChange(state, virtual.skip - 1, virtual.pageSize);\n }\n else if (!opened && virtual.skip + virtual.pageSize < virtual.total &&\n areSame(item, data[data.length - 1], dataItemKey)) {\n this.triggerOnPageChange(state, virtual.skip + 1, virtual.pageSize);\n }\n }\n };\n DropDownBase.prototype.getPopupSettings = function () {\n return Object\n .assign({}, DropDownBase.defaultProps.popupSettings, this.component.props.popupSettings);\n };\n DropDownBase.prototype.getGroupedDataModernMode = function (data, groupField) {\n var newData = [];\n data.forEach(function (el, index) {\n var _a;\n if (data[index - 1] && el[groupField] !== data[index - 1][groupField]) {\n newData.push((_a = {}, _a[groupField] = el[groupField], _a));\n newData.push(data[index]);\n }\n else {\n newData.push(data[index]);\n }\n });\n return newData;\n };\n DropDownBase.basicPropTypes = {\n opened: PropTypes.bool,\n disabled: PropTypes.bool,\n dir: PropTypes.string,\n tabIndex: PropTypes.number,\n accessKey: PropTypes.string,\n data: PropTypes.array,\n textField: PropTypes.string,\n className: PropTypes.string,\n label: PropTypes.string,\n loading: PropTypes.bool,\n popupSettings: PropTypes.shape({\n animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({\n openDuration: PropTypes.number,\n closeDuration: PropTypes.number\n })]),\n popupClass: PropTypes.string,\n className: PropTypes.string,\n appendTo: PropTypes.any,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n }),\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n itemRender: PropTypes.func,\n listNoDataRender: PropTypes.func,\n focusedItemIndex: PropTypes.func,\n header: PropTypes.node,\n footer: PropTypes.node\n };\n DropDownBase.propTypes = __assign(__assign({}, DropDownBase.basicPropTypes), { value: PropTypes.any, defaultValue: PropTypes.any, filterable: PropTypes.bool, filter: PropTypes.string, virtual: PropTypes.shape({\n pageSize: PropTypes.number.isRequired,\n skip: PropTypes.number.isRequired,\n total: PropTypes.number.isRequired\n }), onFilterChange: PropTypes.func, onPageChange: PropTypes.func });\n DropDownBase.defaultProps = {\n popupSettings: {\n height: '200px'\n },\n required: false,\n validityStyles: true\n };\n return DropDownBase;\n}());\nexport default DropDownBase;\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-dropdowns',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801683,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","/** @hidden */\nexport var MOBILE_SMALL_DEVISE = 500;\n/** @hidden */\nexport var MOBILE_MEDIUM_DEVISE = 768;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\nvar TabStripNavigationItem = /** @class */ (function (_super) {\n __extends(TabStripNavigationItem, _super);\n function TabStripNavigationItem() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onClick = function () {\n if (_this.props.onSelect) {\n _this.props.onSelect(_this.props.index);\n }\n };\n return _this;\n }\n /**\n * @hidden\n */\n TabStripNavigationItem.prototype.render = function () {\n var _a;\n var _b = this.props, id = _b.id, active = _b.active, disabled = _b.disabled, _c = _b.title, title = _c === void 0 ? 'Untitled' : _c, first = _b.first, last = _b.last;\n var props = {\n 'id': id,\n 'aria-selected': active,\n 'aria-controls': id,\n 'aria-disabled': disabled,\n 'aria-hidden': disabled,\n 'role': 'tab',\n onClick: !disabled ? this.onClick : undefined\n };\n var itemClasses = classNames('k-item', (_a = {},\n _a['k-first'] = first,\n _a['k-last'] = last,\n _a['k-disabled'] = disabled,\n _a['k-active'] = active,\n _a));\n return (React.createElement(\"li\", __assign({}, props, { className: itemClasses }),\n React.createElement(\"span\", { className: \"k-link\" }, title)));\n };\n /**\n * @hidden\n */\n TabStripNavigationItem.propTypes = {\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n index: PropTypes.number,\n onSelect: PropTypes.func,\n title: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n first: PropTypes.bool,\n last: PropTypes.bool\n };\n return TabStripNavigationItem;\n}(React.Component));\nexport { TabStripNavigationItem };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { TabStripNavigationItem } from './TabStripNavigationItem';\nimport { classNames } from '@progress/kendo-react-common';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon, caretAltUpIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nvar times = function (count) { return Array.apply(null, Array(count)); };\nvar preventDefault = function (e) { return e.preventDefault(); };\nvar DEFAULT_SCROLL_BEHAVIOR = 'smooth';\nvar PREV = 'prev';\nvar NEXT = 'next';\nvar TabStripNavigation = /** @class */ (function (_super) {\n __extends(TabStripNavigation, _super);\n function TabStripNavigation(props) {\n var _this = _super.call(this, props) || this;\n _this.itemsNavRef = React.createRef();\n _this.isRtl = function () { return _this.props.dir === 'rtl'; };\n _this.onWheel = function (e) {\n e.stopPropagation();\n var direction = e.deltaY < 0 ? PREV : NEXT;\n _this.setNewScrollPosition(direction, e);\n };\n _this.arrowClickPrev = function (e) {\n _this.handleArrowClick(PREV, e);\n };\n _this.arrowClickNext = function (e) {\n _this.handleArrowClick(NEXT, e);\n };\n _this.handleArrowClick = function (direction, e) {\n _this.setNewScrollPosition(direction, e);\n };\n _this.setNewScrollPosition = function (direction, e) {\n var list = _this.itemsNavRef.current;\n if (!list) {\n return;\n }\n var horizontal = _this.horizontalScroll();\n var scrollEnd = horizontal ? list.scrollWidth - list.offsetWidth : list.scrollHeight - list.offsetHeight;\n var increment = (e.type === 'click' ? _this.props.buttonScrollSpeed : _this.props.mouseScrollSpeed) || 0;\n var scrollPosition = horizontal ? list.scrollLeft : list.scrollTop;\n var nextScrollPosition = horizontal ? list.scrollWidth - list.scrollLeft : list.scrollHeight - list.scrollTop;\n var nextScrollPositionRtl = list.scrollWidth - (list.scrollLeft * -1);\n if (_this.isRtl() && _this.horizontalScroll()) {\n if (direction === PREV && scrollPosition < 0) {\n scrollPosition += increment;\n nextScrollPositionRtl += increment;\n }\n if (direction === NEXT && scrollPosition < scrollEnd) {\n scrollPosition -= increment;\n nextScrollPositionRtl -= increment;\n }\n scrollPosition = Math.min(0, Math.min(scrollEnd, scrollPosition));\n }\n else {\n if (direction === PREV && scrollPosition > 0) {\n scrollPosition -= increment;\n nextScrollPosition += increment;\n }\n if (direction === NEXT && scrollPosition < scrollEnd) {\n scrollPosition += increment;\n nextScrollPosition -= increment;\n }\n scrollPosition = Math.max(0, Math.min(scrollEnd, scrollPosition));\n }\n var calculatePrev = scrollPosition === 0;\n var scrollBehavior = e.type === 'click' ? DEFAULT_SCROLL_BEHAVIOR : undefined;\n if (horizontal) {\n var calculateNext = _this.isRtl()\n ? Math.round(nextScrollPositionRtl) <= list.clientWidth\n || Math.floor(nextScrollPositionRtl) <= list.clientWidth\n : Math.round(nextScrollPosition) <= list.clientWidth\n || Math.floor(nextScrollPosition) <= list.clientWidth;\n _this.setState({\n disabledPrev: calculatePrev,\n disabledNext: calculateNext\n });\n list.scrollTo({ left: scrollPosition, behavior: scrollBehavior });\n }\n else {\n _this.setState({\n disabledPrev: calculatePrev,\n disabledNext: Math.round(nextScrollPosition) <= list.clientHeight\n || Math.floor(nextScrollPosition) <= list.clientHeight\n });\n list.scrollTo({ top: scrollPosition, behavior: scrollBehavior });\n }\n };\n _this.renderArrow = function (type, disabled) {\n var horizontal = _this.horizontalScroll();\n var directions = {\n prev: {\n arrowTab: 'k-tabstrip-prev',\n fontIcon: horizontal ?\n _this.isRtl() ? 'caret-alt-right' : 'caret-alt-left'\n : 'caret-alt-up',\n svgIcon: horizontal ?\n _this.isRtl() ? caretAltRightIcon : caretAltLeftIcon\n : caretAltUpIcon\n },\n next: {\n arrowTab: 'k-tabstrip-next',\n fontIcon: horizontal ?\n _this.isRtl() ? 'caret-alt-left' : 'caret-alt-right'\n : 'caret-alt-down',\n svgIcon: horizontal ?\n _this.isRtl() ? caretAltLeftIcon : caretAltRightIcon\n : caretAltDownIcon\n }\n };\n var ButtonComponent = (type === PREV ? _this.props.prevButton : _this.props.nextButton) || Button;\n var onClick = (type === PREV ? _this.arrowClickPrev : _this.arrowClickNext);\n return (React.createElement(ButtonComponent, { disabled: disabled, className: \"\".concat(directions[type].arrowTab), onClick: onClick, icon: directions[type].fontIcon, svgIcon: directions[type].svgIcon, onMouseDown: preventDefault, tabIndex: -1, fillMode: \"flat\" }));\n };\n _this.state = {\n disabledPrev: _this.props.selected === 0,\n disabledNext: _this.props.selected === React.Children.count(_this.props.children) - 1\n };\n return _this;\n }\n /**\n * @hidden\n */\n TabStripNavigation.prototype.componentDidMount = function () {\n if (this.props.scrollable) {\n this.scrollToSelected();\n }\n };\n /**\n * @hidden\n */\n TabStripNavigation.prototype.componentDidUpdate = function (prevProps) {\n var _a = this.props, scrollable = _a.scrollable, selected = _a.selected;\n if (scrollable && prevProps.selected !== selected) {\n this.scrollToSelected();\n this.setState({\n disabledPrev: selected === 0,\n disabledNext: selected === React.Children.count(this.props.children) - 1\n });\n }\n };\n /**\n * @hidden\n */\n TabStripNavigation.prototype.render = function () {\n var _a = this.props, selected = _a.selected, tabPosition = _a.tabPosition, children = _a.children, onSelect = _a.onSelect, onKeyDown = _a.onKeyDown;\n var tabsCount = React.Children.count(children);\n var childElements = React.Children.toArray(children);\n var tabs;\n if (children) {\n tabs = times(tabsCount).map(function (_, index, array) {\n var tabProps = {\n active: selected === index,\n disabled: childElements[index].props.disabled,\n index: index,\n title: childElements[index].props.title,\n first: index === 0,\n last: index === array.length - 1,\n onSelect: onSelect\n };\n return React.createElement(TabStripNavigationItem, __assign({ key: index }, tabProps));\n });\n }\n var wrapperClasses = classNames('k-tabstrip-items-wrapper', {\n 'k-hstack': tabPosition === 'top' || tabPosition === 'bottom',\n 'k-vstack': tabPosition === 'left' || tabPosition === 'right'\n });\n var navClasses = classNames('k-tabstrip-items', 'k-reset');\n return (React.createElement(\"div\", { className: wrapperClasses }, this.props.scrollable ? (React.createElement(React.Fragment, null,\n this.renderArrow(PREV, this.state.disabledPrev),\n React.createElement(\"ul\", { ref: this.itemsNavRef, className: navClasses, role: 'tablist', tabIndex: this.props.tabIndex, onKeyDown: onKeyDown, onWheel: this.onWheel }, tabs),\n this.renderArrow(NEXT, this.state.disabledNext))) : (React.createElement(\"ul\", { className: navClasses, role: 'tablist', tabIndex: this.props.tabIndex, onKeyDown: onKeyDown }, tabs))));\n };\n TabStripNavigation.prototype.scrollToSelected = function () {\n var _a, _b, _c, _d;\n var list = this.itemsNavRef.current;\n var tab = list && list.children[this.props.selected || 0];\n if (tab instanceof HTMLElement && list instanceof HTMLElement) {\n var horizontal = this.horizontalScroll();\n var listSize = horizontal ? list.offsetWidth : list.offsetHeight;\n var tabSize = horizontal ? tab.offsetWidth : tab.offsetHeight;\n var scrollDir = horizontal ? 'left' : 'top';\n var currentScrollOffset = horizontal ? list.scrollLeft : list.scrollTop;\n var scrollPosition = 0;\n if (this.isRtl()) {\n var tabOffset = tab.offsetLeft;\n currentScrollOffset = currentScrollOffset * -1;\n if (tabOffset < 0) {\n scrollPosition = tabOffset - tabSize + list.offsetLeft;\n list.scrollTo((_a = {}, _a[scrollDir] = scrollPosition, _a.behavior = DEFAULT_SCROLL_BEHAVIOR, _a));\n }\n else if (tabOffset + tabSize > listSize - currentScrollOffset) {\n scrollPosition = currentScrollOffset + tabOffset - tabSize;\n list.scrollTo((_b = {}, _b[scrollDir] = scrollPosition, _b.behavior = DEFAULT_SCROLL_BEHAVIOR, _b));\n }\n }\n else {\n var tabOffset = horizontal ? tab.offsetLeft - list.offsetLeft : tab.offsetTop - list.offsetTop;\n if (currentScrollOffset + listSize < tabOffset + tabSize) {\n scrollPosition = tabOffset + tabSize - listSize;\n list.scrollTo((_c = {}, _c[scrollDir] = scrollPosition, _c.behavior = DEFAULT_SCROLL_BEHAVIOR, _c));\n }\n else if (currentScrollOffset > tabOffset) {\n scrollPosition = tabOffset;\n list.scrollTo((_d = {}, _d[scrollDir] = scrollPosition, _d.behavior = DEFAULT_SCROLL_BEHAVIOR, _d));\n }\n }\n }\n };\n TabStripNavigation.prototype.horizontalScroll = function () {\n return /top|bottom/.test(this.props.tabPosition || 'top');\n };\n ;\n /**\n * @hidden\n */\n TabStripNavigation.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.arrayOf(PropTypes.element)\n ]),\n onSelect: PropTypes.func,\n onKeyDown: PropTypes.func,\n selected: PropTypes.number,\n tabIndex: PropTypes.number\n };\n return TabStripNavigation;\n}(React.Component));\nexport { TabStripNavigation };\n","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n *
\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n *
\n * {\"I'll receive my-node-* classes\"}\n *
\n *
\n * \n *
\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","/**\n * @hidden\n */\nvar outerHeight = function (element) {\n if (!element || !element.ownerDocument.defaultView) {\n return 0;\n }\n var wnd = element.ownerDocument.defaultView;\n var computedStyles = wnd.getComputedStyle(element);\n var marginTop = parseFloat(computedStyles.marginTop);\n var marginBottom = parseFloat(computedStyles.marginBottom);\n return element.offsetHeight + marginTop + marginBottom;\n};\n/**\n * @hidden\n */\nvar outerWidth = function (element) {\n if (!element || !element.ownerDocument.defaultView) {\n return 0;\n }\n var wnd = element.ownerDocument.defaultView;\n var computedStyles = wnd.getComputedStyle(element);\n var marginLeft = parseFloat(computedStyles.marginLeft);\n var marginRight = parseFloat(computedStyles.marginRight);\n return element.offsetWidth + marginLeft + marginRight;\n};\n/**\n * @hidden\n */\nvar styles = {\n 'animation-container': 'k-animation-container',\n 'animation-container-relative': 'k-animation-container-relative',\n 'animation-container-fixed': 'k-animation-container-fixed',\n 'push-right-enter': 'k-push-right-enter',\n 'push-right-appear': 'k-push-right-appear',\n 'push-right-enter-active': 'k-push-right-enter-active',\n 'push-right-appear-active': 'k-push-right-appear-active',\n 'push-right-exit': 'k-push-right-exit',\n 'push-right-exit-active': 'k-push-right-exit-active',\n 'push-left-enter': 'k-push-left-enter',\n 'push-left-appear': 'k-push-left-appear',\n 'push-left-enter-active': 'k-push-left-enter-active',\n 'push-left-appear-active': 'k-push-left-appear-active',\n 'push-left-exit': 'k-push-left-exit',\n 'push-left-exit-active': 'k-push-left-exit-active',\n 'push-down-enter': 'k-push-down-enter',\n 'push-down-appear': 'k-push-down-appear',\n 'push-down-enter-active': 'k-push-down-enter-active',\n 'push-down-appear-active': 'k-push-down-appear-active',\n 'push-down-exit': 'k-push-down-exit',\n 'push-down-exit-active': 'k-push-down-exit-active',\n 'push-up-enter': 'k-push-up-enter',\n 'push-up-appear': 'k-push-up-appear',\n 'push-up-enter-active': 'k-push-up-enter-active',\n 'push-up-appear-active': 'k-push-up-appear-active',\n 'push-up-exit': 'k-push-up-exit',\n 'push-up-exit-active': 'k-push-up-exit-active',\n 'expand': 'k-expand',\n 'expand-vertical-enter': 'k-expand-vertical-enter',\n 'expand-vertical-appear': 'k-expand-vertical-appear',\n 'expand-vertical-enter-active': 'k-expand-vertical-enter-active',\n 'expand-vertical-appear-active': 'k-expand-vertical-appear-active',\n 'expand-vertical-exit': 'k-expand-vertical-exit',\n 'expand-vertical-exit-active': 'k-expand-vertical-exit-active',\n 'expand-horizontal-enter': 'k-expand-horizontal-enter',\n 'expand-horizontal-appear': 'k-expand-horizontal-appear',\n 'expand-horizontal-enter-active': 'k-expand-horizontal-enter-active',\n 'expand-horizontal-appear-active': 'k-expand-horizontal-appear-active',\n 'expand-horizontal-exit': 'k-expand-horizontal-exit',\n 'expand-horizontal-exit-active': 'k-expand-horizontal-exit-active',\n 'child-animation-container': 'k-child-animation-container',\n 'fade-enter': 'k-fade-enter',\n 'fade-appear': 'k-fade-appear',\n 'fade-enter-active': 'k-fade-enter-active',\n 'fade-appear-active': 'k-fade-appear-active',\n 'fade-exit': 'k-fade-exit',\n 'fade-exit-active': 'k-fade-exit-active',\n 'zoom-in-enter': 'k-zoom-in-enter',\n 'zoom-in-appear': 'k-zoom-in-appear',\n 'zoom-in-enter-active': 'k-zoom-in-enter-active',\n 'zoom-in-appear-active': 'k-zoom-in-appear-active',\n 'zoom-in-exit': 'k-zoom-in-exit',\n 'zoom-in-exit-active': 'k-zoom-in-exit-active',\n 'zoom-out-enter': 'k-zoom-out-enter',\n 'zoom-out-appear': 'k-zoom-out-appear',\n 'zoom-out-enter-active': 'k-zoom-out-enter-active',\n 'zoom-out-appear-active': 'k-zoom-out-appear-active',\n 'zoom-out-exit': 'k-zoom-out-exit',\n 'zoom-out-exit-active': 'k-zoom-out-exit-active',\n 'slide-in-appear': 'k-slide-in-appear',\n 'centered': 'k-centered',\n 'slide-in-appear-active': 'k-slide-in-appear-active',\n 'slide-down-enter': 'k-slide-down-enter',\n 'slide-down-appear': 'k-slide-down-appear',\n 'slide-down-enter-active': 'k-slide-down-enter-active',\n 'slide-down-appear-active': 'k-slide-down-appear-active',\n 'slide-down-exit': 'k-slide-down-exit',\n 'slide-down-exit-active': 'k-slide-down-exit-active',\n 'slide-up-enter': 'k-slide-up-enter',\n 'slide-up-appear': 'k-slide-up-appear',\n 'slide-up-enter-active': 'k-slide-up-enter-active',\n 'slide-up-appear-active': 'k-slide-up-appear-active',\n 'slide-up-exit': 'k-slide-up-exit',\n 'slide-up-exit-active': 'k-slide-up-exit-active',\n 'slide-right-enter': 'k-slide-right-enter',\n 'slide-right-appear': 'k-slide-right-appear',\n 'slide-right-enter-active': 'k-slide-right-enter-active',\n 'slide-right-appear-active': 'k-slide-right-appear-active',\n 'slide-right-exit': 'k-slide-right-exit',\n 'slide-right-exit-active': 'k-slide-right-exit-active',\n 'slide-left-enter': 'k-slide-left-enter',\n 'slide-left-appear': 'k-slide-left-appear',\n 'slide-left-enter-active': 'k-slide-left-enter-active',\n 'slide-left-appear-active': 'k-slide-left-appear-active',\n 'slide-left-exit': 'k-slide-left-exit',\n 'slide-left-exit-active': 'k-slide-left-exit-active',\n 'reveal-vertical-enter': 'k-reveal-vertical-enter',\n 'reveal-vertical-appear': 'k-reveal-vertical-appear',\n 'reveal-vertical-enter-active': 'k-reveal-vertical-enter-active',\n 'reveal-vertical-appear-active': 'k-reveal-vertical-appear-active',\n 'reveal-vertical-exit': 'k-reveal-vertical-exit',\n 'reveal-vertical-exit-active': 'k-reveal-vertical-exit-active',\n 'reveal-horizontal-enter': 'k-reveal-horizontal-enter',\n 'reveal-horizontal-appear': 'k-reveal-horizontal-appear',\n 'reveal-horizontal-enter-active': 'k-reveal-horizontal-enter-active',\n 'reveal-horizontal-appear-active': 'k-reveal-horizontal-appear-active',\n 'reveal-horizontal-exit': 'k-reveal-horizontal-exit',\n 'reveal-horizontal-exit-active': 'k-reveal-horizontal-exit-active'\n};\n/**\n * @hidden\n */\nvar stylesMap = {\n outerHeight: outerHeight,\n outerWidth: outerWidth,\n styles: styles\n};\nexport default stylesMap;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, noop } from '@progress/kendo-react-common';\nimport { CSSTransition } from 'react-transition-group';\nimport util from './util';\nvar styles = util.styles;\nvar AnimationChild = /** @class */ (function (_super) {\n __extends(AnimationChild, _super);\n function AnimationChild() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.elementRef = React.createRef();\n return _this;\n }\n Object.defineProperty(AnimationChild.prototype, \"element\", {\n /**\n * The element that is being animated.\n */\n get: function () {\n return this.elementRef.current;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n AnimationChild.prototype.render = function () {\n var _this = this;\n var _a = this.props, children = _a.children, style = _a.style, appear = _a.appear, enter = _a.enter, exit = _a.exit, transitionName = _a.transitionName, transitionEnterDuration = _a.transitionEnterDuration, transitionExitDuration = _a.transitionExitDuration, className = _a.className, onEnter = _a.onEnter, onEntering = _a.onEntering, onEntered = _a.onEntered, onExit = _a.onExit, onExiting = _a.onExiting, onExited = _a.onExited, onAfterExited = _a.onAfterExited, mountOnEnter = _a.mountOnEnter, unmountOnExit = _a.unmountOnExit, animationEnteringStyle = _a.animationEnteringStyle, animationEnteredStyle = _a.animationEnteredStyle, animationExitingStyle = _a.animationExitingStyle, animationExitedStyle = _a.animationExitedStyle, other = __rest(_a, [\"children\", \"style\", \"appear\", \"enter\", \"exit\", \"transitionName\", \"transitionEnterDuration\", \"transitionExitDuration\", \"className\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"onAfterExited\", \"mountOnEnter\", \"unmountOnExit\", \"animationEnteringStyle\", \"animationEnteredStyle\", \"animationExitingStyle\", \"animationExitedStyle\"]);\n var childAnimationContainerClassNames = classNames(className, styles['child-animation-container']);\n var defaultStyle = __assign({ transitionDelay: '0ms' }, style);\n var animationStyle = {\n entering: __assign({ transitionDuration: \"\".concat(transitionEnterDuration, \"ms\") }, animationEnteringStyle),\n entered: __assign({}, animationEnteredStyle),\n exiting: __assign({ transitionDuration: \"\".concat(transitionExitDuration, \"ms\") }, animationExitingStyle),\n exited: __assign({}, animationExitedStyle)\n };\n var transitionProps = {\n in: this.props.in,\n appear: appear,\n enter: enter,\n exit: exit,\n mountOnEnter: mountOnEnter,\n unmountOnExit: unmountOnExit,\n timeout: {\n enter: transitionEnterDuration,\n exit: transitionExitDuration\n },\n onEnter: (function () {\n if (onEnter) {\n onEnter.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n onEntering: (function () {\n if (onEntering) {\n onEntering.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n onEntered: (function () {\n if (onEntered) {\n onEntered.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n onExit: (function () {\n if (onExit) {\n onExit.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n onExiting: (function () {\n if (onExiting) {\n onExiting.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n onExited: (function () {\n if (onAfterExited) {\n onAfterExited.call(undefined, { animatedElement: _this.element, target: _this });\n }\n if (onExited) {\n onExited.call(undefined, { animatedElement: _this.element, target: _this });\n }\n }),\n classNames: {\n appear: styles[\"\".concat(transitionName, \"-appear\")] || \"\".concat(transitionName, \"-appear\"),\n appearActive: styles[\"\".concat(transitionName, \"-appear-active\")] || \"\".concat(transitionName, \"-appear-active\"),\n enter: styles[\"\".concat(transitionName, \"-enter\")] || \"\".concat(transitionName, \"-enter\"),\n enterActive: styles[\"\".concat(transitionName, \"-enter-active\")] || \"\".concat(transitionName, \"-enter-active\"),\n exit: styles[\"\".concat(transitionName, \"-exit\")] || \"\".concat(transitionName, \"-exit\"),\n exitActive: styles[\"\".concat(transitionName, \"-exit-active\")] || \"\".concat(transitionName, \"-exit-active\")\n }\n };\n return (React.createElement(CSSTransition, __assign({}, transitionProps, other, { nodeRef: this.elementRef }), function (status) {\n return (React.createElement(\"div\", { style: __assign(__assign({}, defaultStyle), animationStyle[status]), className: childAnimationContainerClassNames, ref: _this.elementRef }, children));\n }));\n };\n /**\n * @hidden\n */\n AnimationChild.propTypes = {\n in: PropTypes.bool,\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n transitionName: PropTypes.string.isRequired,\n className: PropTypes.string,\n appear: PropTypes.bool,\n enter: PropTypes.bool,\n exit: PropTypes.bool,\n transitionEnterDuration: PropTypes.number.isRequired,\n transitionExitDuration: PropTypes.number.isRequired,\n mountOnEnter: PropTypes.bool,\n unmountOnExit: PropTypes.bool,\n animationEnteringStyle: PropTypes.object,\n animationEnteredStyle: PropTypes.object,\n animationExitingStyle: PropTypes.object,\n animationExitedStyle: PropTypes.object\n };\n /**\n * @hidden\n */\n AnimationChild.defaultProps = {\n mountOnEnter: true,\n unmountOnExit: false,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop,\n onAfterExited: noop,\n animationEnteringStyle: {},\n animationEnteredStyle: {},\n animationExitingStyle: {},\n animationExitedStyle: {}\n };\n return AnimationChild;\n}(React.Component));\nexport { AnimationChild };\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-animation',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695800856,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\nimport { AnimationChild } from './AnimationChild';\nimport { TransitionGroup } from 'react-transition-group';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from './package-metadata';\nimport util from './util';\nvar styles = util.styles;\n// tslint:enable:max-line-length\nvar Animation = /** @class */ (function (_super) {\n __extends(Animation, _super);\n function Animation(props) {\n var _this = _super.call(this, props) || this;\n validatePackage(packageMetadata);\n return _this;\n }\n /**\n * @hidden\n */\n Animation.prototype.render = function () {\n var _a = this.props, id = _a.id, style = _a.style, children = _a.children, component = _a.component, className = _a.className, childFactory = _a.childFactory, stackChildren = _a.stackChildren, componentChildStyle = _a.componentChildStyle, componentChildClassName = _a.componentChildClassName, other = __rest(_a, [\"id\", \"style\", \"children\", \"component\", \"className\", \"childFactory\", \"stackChildren\", \"componentChildStyle\", \"componentChildClassName\"]);\n var transitionProps = {\n id: id,\n style: style,\n component: component,\n childFactory: childFactory,\n className: classNames(styles['animation-container'], styles['animation-container-relative'], className)\n };\n var content = React.Children.map(children || null, function (child) { return (React.createElement(AnimationChild, __assign({}, other, { style: componentChildStyle, className: componentChildClassName }), child)); });\n return (React.createElement(TransitionGroup, __assign({}, transitionProps), content));\n };\n /**\n * @hidden\n */\n Animation.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n childFactory: PropTypes.any,\n className: PropTypes.string,\n component: PropTypes.string,\n id: PropTypes.string,\n style: PropTypes.any,\n transitionName: PropTypes.string.isRequired,\n appear: PropTypes.bool.isRequired,\n enter: PropTypes.bool.isRequired,\n exit: PropTypes.bool.isRequired,\n transitionEnterDuration: PropTypes.number.isRequired,\n transitionExitDuration: PropTypes.number.isRequired\n };\n /**\n * @hidden\n */\n Animation.defaultProps = {\n component: 'div'\n };\n return Animation;\n}(React.Component));\nexport { Animation };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Animation } from './Animation';\n// tslint:enable:max-line-length\nvar Fade = /** @class */ (function (_super) {\n __extends(Fade, _super);\n function Fade() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n Fade.prototype.render = function () {\n var _a = this.props, children = _a.children, other = __rest(_a, [\"children\"]);\n var animationProps = {\n transitionName: 'fade'\n };\n return (React.createElement(Animation, __assign({}, animationProps, other), children));\n };\n /**\n * @hidden\n */\n Fade.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n childFactory: PropTypes.any,\n className: PropTypes.string,\n component: PropTypes.string,\n id: PropTypes.string,\n style: PropTypes.any\n };\n /**\n * @hidden\n */\n Fade.defaultProps = {\n appear: false,\n enter: true,\n exit: false,\n transitionEnterDuration: 500,\n transitionExitDuration: 500\n };\n return Fade;\n}(React.Component));\nexport { Fade };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Animation } from './Animation';\n// tslint:enable:max-line-length\nvar Slide = /** @class */ (function (_super) {\n __extends(Slide, _super);\n function Slide() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n Slide.prototype.render = function () {\n var _a = this.props, direction = _a.direction, children = _a.children, other = __rest(_a, [\"direction\", \"children\"]);\n var animationProps = {\n transitionName: \"slide-\".concat(direction)\n };\n return (React.createElement(Animation, __assign({}, animationProps, other), children));\n };\n /**\n * @hidden\n */\n Slide.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n childFactory: PropTypes.any,\n className: PropTypes.string,\n direction: PropTypes.oneOf([\n 'up',\n 'down',\n 'left',\n 'right'\n ]),\n component: PropTypes.string,\n id: PropTypes.string,\n style: PropTypes.any\n };\n /**\n * @hidden\n */\n Slide.defaultProps = {\n appear: false,\n enter: true,\n exit: true,\n transitionEnterDuration: 300,\n transitionExitDuration: 300,\n direction: 'down'\n };\n return Slide;\n}(React.Component));\nexport { Slide };\n","import * as React from 'react';\n/** @hidden */\nexport var useAnimation = function (config, deps) {\n var offset = React.useRef(0);\n var mount = React.useRef(false);\n var animationFrame = React.useRef();\n var animate = function (transition) {\n var duration = transition.duration;\n var start;\n var progress;\n var skip = offset.current && 1 - offset.current;\n if (transition.onStart) {\n transition.onStart();\n }\n var frame = function (timestamp) {\n if (!start) {\n start = timestamp;\n }\n progress = timestamp - start + 1;\n var rate = progress / duration + skip;\n if (rate <= 1) {\n if (transition.onUpdate) {\n transition.onUpdate(rate);\n }\n animationFrame.current = window.requestAnimationFrame(frame);\n offset.current = rate;\n }\n else {\n if (transition.onEnd) {\n transition.onEnd(1);\n }\n offset.current = 0;\n }\n };\n animationFrame.current = window.requestAnimationFrame(frame);\n };\n React.useEffect(function () {\n animate(config);\n return function () {\n if (animationFrame.current) {\n window.cancelAnimationFrame(animationFrame.current);\n }\n };\n }, deps);\n React.useEffect(function () {\n mount.current = true;\n }, []);\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Fade } from '@progress/kendo-react-animation';\nimport { classNames, guid } from '@progress/kendo-react-common';\nvar TabStripContent = /** @class */ (function (_super) {\n __extends(TabStripContent, _super);\n function TabStripContent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.contentId = guid();\n _this.childFactory = function (child) {\n return React.cloneElement(child, __assign(__assign({}, child.props), { in: child.props.children.props.id === String(_this.contentId + _this.props.selected) }));\n };\n return _this;\n }\n /**\n * @hidden\n */\n TabStripContent.prototype.render = function () {\n var _a = this.props, children = _a.children, selected = _a.selected;\n var selectedTab = children && typeof selected === 'number' &&\n React.Children.toArray(children)[selected];\n var contentClasses = classNames('k-tabstrip-content', 'k-active', selectedTab && selectedTab.props.contentClassName);\n return (React.createElement(\"div\", { className: contentClasses, style: this.props.style }, this.renderContent(children)));\n };\n TabStripContent.prototype.renderContent = function (children) {\n var _this = this;\n return !this.props.keepTabsMounted\n ? this.renderChild(React.Children.toArray(children)[this.props.selected], this.props.selected)\n : React.Children.map(this.props.children, function (tab, idx) {\n return _this.renderChild(tab, idx);\n });\n };\n TabStripContent.prototype.renderChild = function (tab, idx) {\n var visible = idx === this.props.selected;\n var contentProps = {\n 'role': 'tabpanel',\n 'aria-expanded': true,\n 'aria-labelledby': idx.toString(),\n 'style': {\n 'display': visible ? undefined : 'none'\n }\n };\n var animationStyle = {\n position: 'initial',\n display: visible ? undefined : 'none'\n };\n if (tab.props.disabled) {\n return null;\n }\n return this.props.animation\n ? (React.createElement(Fade, { appear: true, exit: this.props.keepTabsMounted, style: animationStyle, childFactory: this.props.keepTabsMounted ? this.childFactory : undefined },\n React.createElement(\"div\", __assign({}, contentProps, { id: String(this.contentId + idx), key: idx }), tab.props.children)))\n : (React.createElement(\"div\", __assign({}, contentProps, { key: idx }), tab.props.children));\n };\n /**\n * @hidden\n */\n TabStripContent.propTypes = {\n animation: PropTypes.bool,\n children: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.arrayOf(PropTypes.element)\n ]),\n selected: PropTypes.number,\n style: PropTypes.object\n };\n return TabStripContent;\n}(React.Component));\nexport { TabStripContent };\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-layout',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801122,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { TabStripNavigation } from './TabStripNavigation';\nimport { TabStripContent } from './TabStripContent';\nimport { Keys, classNames, validatePackage, shouldShowValidationUI, WatermarkOverlay } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nvar TabStrip = /** @class */ (function (_super) {\n __extends(TabStrip, _super);\n function TabStrip(props) {\n var _a;\n var _this = _super.call(this, props) || this;\n _this._element = null;\n _this.showLicenseWatermark = false;\n _this.keyBinding = (_a = {},\n _a[Keys.left] = function () { return _this.prevNavigatableTab(); },\n _a[Keys.right] = function () { return _this.nextNavigatableTab(); },\n _a[Keys.down] = function () { return _this.nextNavigatableTab(); },\n _a[Keys.up] = function () { return _this.prevNavigatableTab(); },\n _a[Keys.home] = function () { return 0; },\n _a[Keys.end] = function () { return (React.Children.count(_this.props.children) - 1); },\n _a);\n /**\n * @hidden\n */\n _this.onSelect = function (index) {\n if (_this.props.selected !== index) {\n if (_this.props.onSelect) {\n _this.props.onSelect({\n selected: index\n });\n }\n }\n };\n /**\n * @hidden\n */\n _this.onKeyDown = function (event) {\n var handler;\n switch (event.keyCode) {\n case Keys.left:\n handler = _this.keyBinding[_this.invertKeys(Keys.left, Keys.right)];\n break;\n case Keys.right:\n handler = _this.keyBinding[_this.invertKeys(Keys.right, Keys.left)];\n break;\n case Keys.up:\n handler = _this.keyBinding[Keys.up];\n break;\n case Keys.down:\n handler = _this.keyBinding[Keys.down];\n break;\n case Keys.home:\n handler = _this.keyBinding[Keys.home];\n break;\n case Keys.end:\n handler = _this.keyBinding[Keys.end];\n break;\n default:\n break;\n }\n if (handler) {\n event.preventDefault();\n _this.onSelect(handler());\n }\n };\n _this.renderContent = function (tabProps) {\n var selected = tabProps.selected, children = tabProps.children, tabContentStyle = tabProps.tabContentStyle;\n var childrenCount = React.Children.count(children);\n if (selected < childrenCount && selected > -1) {\n return (React.createElement(TabStripContent, __assign({ index: selected }, tabProps, { style: tabContentStyle })));\n }\n return null;\n };\n _this.firstNavigatableTab = function () {\n var children = _this.children();\n var length = React.Children.count(children);\n if (children) {\n for (var i = 0; i < length; i++) {\n if (!children[i].props.disabled) {\n return i;\n }\n }\n }\n };\n _this.lastNavigatableTab = function () {\n var children = _this.children();\n var length = React.Children.count(children);\n if (children) {\n for (var i = length - 1; i > 0; i--) {\n if (!children[i].props.disabled) {\n return i;\n }\n }\n }\n };\n _this.prevNavigatableTab = function () {\n var children = _this.children();\n var selected = _this.props.selected;\n var index = selected ? selected - 1 : -1;\n if (index < 0) {\n return _this.lastNavigatableTab();\n }\n if (children) {\n for (var i = index; i > -1; i--) {\n if (!children[i].props.disabled) {\n return i;\n }\n if (i === 0) {\n return _this.lastNavigatableTab();\n }\n }\n }\n };\n _this.nextNavigatableTab = function () {\n var children = _this.children();\n var selected = _this.props.selected;\n var index = selected ? selected + 1 : 1;\n var childrenCount = React.Children.count(children);\n if (index >= childrenCount) {\n return _this.firstNavigatableTab();\n }\n if (children) {\n for (var i = index; i < childrenCount; i++) {\n if (!children[i].props.disabled) {\n return i;\n }\n if (i + 1 === childrenCount) {\n return _this.firstNavigatableTab();\n }\n }\n }\n };\n validatePackage(packageMetadata);\n _this.showLicenseWatermark = shouldShowValidationUI(packageMetadata);\n return _this;\n }\n /**\n * @hidden\n */\n TabStrip.prototype.render = function () {\n var _this = this;\n var tabProps = __assign(__assign({}, this.props), { children: this.children(), onKeyDown: this.onKeyDown, onSelect: this.onSelect });\n var tabPosition = tabProps.tabPosition, _a = tabProps.tabIndex, tabIndex = _a === void 0 ? 0 : _a;\n var bottom = tabPosition === 'bottom';\n var componentClasses = classNames('k-tabstrip k-pos-relative', {\n 'k-tabstrip-left': tabPosition === 'left',\n 'k-tabstrip-right': tabPosition === 'right',\n 'k-tabstrip-bottom': tabPosition === 'bottom',\n 'k-tabstrip-top': tabPosition === 'top',\n 'k-tabstrip-scrollable': this.props.scrollable\n }, this.props.className);\n return (React.createElement(\"div\", { id: this.props.id, ref: function (div) { return _this._element = div; }, dir: this.props.dir, className: componentClasses, style: this.props.style },\n !bottom && React.createElement(TabStripNavigation, __assign({}, tabProps, { tabIndex: tabIndex })),\n this.renderContent(tabProps),\n bottom && React.createElement(TabStripNavigation, __assign({}, tabProps, { tabIndex: tabIndex })),\n this.showLicenseWatermark && React.createElement(WatermarkOverlay, null)));\n };\n TabStrip.prototype.invertKeys = function (original, inverted) {\n var rtl = this._element && (getComputedStyle(this._element).direction === 'rtl') || false;\n return rtl ? inverted : original;\n };\n TabStrip.prototype.children = function () {\n return React.Children.toArray(this.props.children).filter(function (c) { return c; });\n };\n /**\n * @hidden\n */\n TabStrip.propTypes = {\n animation: PropTypes.bool,\n children: PropTypes.node,\n onSelect: PropTypes.func,\n selected: PropTypes.number,\n style: PropTypes.object,\n tabContentStyle: PropTypes.object,\n tabPosition: PropTypes.string,\n tabIndex: PropTypes.number,\n className: PropTypes.string,\n dir: PropTypes.string\n };\n /**\n * @hidden\n */\n TabStrip.defaultProps = {\n animation: true,\n tabPosition: 'top',\n keepTabsMounted: false,\n buttonScrollSpeed: 100,\n mouseScrollSpeed: 10\n };\n return TabStrip;\n}(React.Component));\nexport { TabStrip };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nvar TabStripTab = /** @class */ (function (_super) {\n __extends(TabStripTab, _super);\n function TabStripTab() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n TabStripTab.prototype.render = function () {\n return null;\n };\n /**\n * @hidden\n */\n TabStripTab.propTypes = {\n disabled: PropTypes.bool,\n contentClassName: PropTypes.string,\n children: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.node\n ]),\n title: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n PropTypes.node\n ])\n };\n return TabStripTab;\n}(React.Component));\nexport { TabStripTab };\n","/**\n * @hidden\n */\nexport var MIN_RATIO = 0.00001;\n/**\n * @hidden\n */\nexport var LABEL_DECIMALS = 3;\n/**\n * @hidden\n */\nexport var DEFAULT_ANIMATION_DURATION = 400;\n/**\n * @hidden\n */\nexport var NO_ANIMATION = 0;\n","import { LABEL_DECIMALS, MIN_RATIO } from './constants';\n/**\n * @hidden\n */\nexport var truncateNumber = function (value) {\n var numberParts = value.toString().split('.');\n return numberParts.length === 1 ? \"\".concat(numberParts[0]) : \"\".concat(numberParts[0], \".\").concat(numberParts[1].substr(0, LABEL_DECIMALS));\n};\n/**\n * @hidden\n */\nexport var calculatePercentage = function (min, max, value) {\n var onePercent = Math.abs((max - min) / 100);\n return Math.abs((value - min) / onePercent);\n};\n/**\n * @hidden\n */\nexport var updateProgress = function (progressRef, progressWrapRef, percentage, isVertical) {\n var progressPercentage = Math.max(percentage, 0.01);\n var progressWrapPercentage = (100 / progressPercentage) * 100;\n if (progressRef.current && progressWrapRef.current) {\n progressRef.current.style.width = !isVertical ? \"\".concat(progressPercentage, \"%\") : '100%';\n progressWrapRef.current.style.width = !isVertical ? \"\".concat(progressWrapPercentage, \"%\") : '100%';\n progressRef.current.style.height = isVertical ? \"\".concat(progressPercentage, \"%\") : '100%';\n progressWrapRef.current.style.height = isVertical ? \"\".concat(progressWrapPercentage, \"%\") : '100%';\n }\n};\n/**\n * @hidden\n */\nexport var calculateRatio = function (min, max, value) {\n return Math.max((value - min) / (max - min), MIN_RATIO);\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-progressbars',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801083,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","import * as React from 'react';\n/** @hidden */\nexport var usePrevious = function (value) {\n var ref = React.useRef();\n React.useEffect(function () {\n ref.current = value;\n });\n return ref.current;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { useAnimation } from '@progress/kendo-react-animation';\nimport { classNames, useRtl, getTabIndex } from '@progress/kendo-react-common';\nimport { calculatePercentage, updateProgress, truncateNumber } from '../common/utils';\nimport { usePrevious } from './hooks/usePrevious';\nimport { DEFAULT_ANIMATION_DURATION, NO_ANIMATION } from '../common/constants';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\n/**\n * Represents the [KendoReact ProgressBar component]({% slug overview_progressbar %}).\n *\n * @example\n * ```jsx\n * const App = () => {\n * return (\n * \n * );\n * };\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var ProgressBar = React.forwardRef(function (props, target) {\n validatePackage(packageMetadata);\n var animation = props.animation, disabled = props.disabled, _a = props.reverse, reverse = _a === void 0 ? defaultProps.reverse : _a, orientation = props.orientation, labelVisible = props.labelVisible, labelPlacement = props.labelPlacement, _b = props.max, max = _b === void 0 ? defaultProps.max : _b, _c = props.min, min = _c === void 0 ? defaultProps.min : _c, tabIndex = props.tabIndex, className = props.className, style = props.style, emptyStyle = props.emptyStyle, emptyClassName = props.emptyClassName, progressStyle = props.progressStyle, progressClassName = props.progressClassName;\n var elementRef = React.useRef(null);\n var progressStatusRef = React.useRef(null);\n var progressStatusWrapRef = React.useRef(null);\n var focusElement = React.useCallback(function () {\n if (elementRef.current) {\n elementRef.current.focus();\n }\n }, []);\n React.useImperativeHandle(target, function () { return ({\n element: elementRef.current,\n progressStatusElement: progressStatusRef.current,\n progressStatusWrapElement: progressStatusWrapRef.current,\n focus: focusElement\n }); });\n var value = (props.value || defaultProps.value);\n var prevValue = usePrevious(value);\n var indeterminateProp = props.value === null;\n var dir = useRtl(elementRef, props.dir);\n var isVertical = orientation === 'vertical';\n var formattedLabel = truncateNumber(value);\n var labelProps = {\n value: value\n };\n var renderLabel = (labelVisible\n ? props.label\n ? React.createElement(\"span\", { className: 'k-progress-status' },\n React.createElement(props.label, __assign({}, labelProps)))\n : React.createElement(\"span\", { className: 'k-progress-status' }, formattedLabel)\n : undefined);\n var wrapperProps = {\n className: classNames('k-progressbar', {\n 'k-progressbar-horizontal': !isVertical,\n 'k-progressbar-vertical': isVertical,\n 'k-progressbar-reverse': reverse,\n 'k-progressbar-indeterminate': indeterminateProp,\n 'k-disabled': disabled\n }, className),\n ref: elementRef,\n dir: dir,\n tabIndex: getTabIndex(tabIndex, disabled),\n role: 'progressbar',\n 'aria-label': props.ariaLabel,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuenow': indeterminateProp ? undefined : value,\n 'aria-disabled': disabled,\n style: style\n };\n var positionClasses = classNames('k-progress-status-wrap', {\n 'k-progress-start': labelPlacement === 'start',\n 'k-progress-center': labelPlacement === 'center',\n 'k-progress-end': labelPlacement === 'end' || labelPlacement === undefined\n });\n var animationDuration = typeof animation !== 'boolean' && animation !== undefined\n ? animation.duration\n : animation\n ? DEFAULT_ANIMATION_DURATION\n : NO_ANIMATION;\n var handleStart = React.useCallback(function () {\n var percentage = calculatePercentage(min, max, prevValue);\n updateProgress(progressStatusRef, progressStatusWrapRef, percentage, isVertical);\n }, [isVertical, max, min, prevValue]);\n var handleUpdate = React.useCallback(function (progress) {\n var percentage = calculatePercentage(min, max, prevValue + (value - prevValue) * progress);\n updateProgress(progressStatusRef, progressStatusWrapRef, percentage, isVertical);\n }, [min, max, prevValue, value, isVertical]);\n var handleEnd = React.useCallback(function () {\n var percentage = calculatePercentage(min, max, value);\n updateProgress(progressStatusRef, progressStatusWrapRef, percentage, isVertical);\n }, [isVertical, max, min, value]);\n useAnimation({\n duration: animationDuration,\n onStart: handleStart,\n onUpdate: handleUpdate,\n onEnd: handleEnd\n }, [value, animationDuration]);\n return (React.createElement(\"div\", __assign({}, wrapperProps),\n React.createElement(\"span\", { className: positionClasses + (emptyClassName ? ' ' + emptyClassName : ''), style: emptyStyle }, renderLabel),\n React.createElement(\"div\", { className: 'k-progressbar-value k-selected', style: progressStyle, ref: progressStatusRef },\n React.createElement(\"span\", { className: positionClasses + (progressClassName ? ' ' + progressClassName : ''), ref: progressStatusWrapRef }, renderLabel))));\n});\nProgressBar.propTypes = {\n animation: PropTypes.any,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n reverse: PropTypes.bool,\n label: PropTypes.any,\n labelVisible: PropTypes.bool,\n labelPlacement: PropTypes.oneOf(['start', 'center', 'end']),\n max: PropTypes.number,\n min: PropTypes.number,\n value: PropTypes.number,\n tabIndex: PropTypes.number,\n emptyStyle: PropTypes.object,\n emptyClassName: PropTypes.string,\n progressStyle: PropTypes.object,\n progressClassName: PropTypes.string\n};\nvar defaultProps = {\n animation: false,\n min: 0,\n max: 100,\n value: 0,\n disabled: false,\n reverse: false,\n labelVisible: true\n};\nProgressBar.defaultProps = defaultProps;\nProgressBar.displayName = 'KendoProgressBar';\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * The KendoReact ActionSheetItem component.\n */\nexport var ActionSheetItem = function (props) {\n var itemRef = React.useRef(null);\n var onClick = React.useCallback(function (event) {\n if (props.onClick) {\n props.onClick.call(undefined, {\n syntheticEvent: event,\n item: props.item,\n title: props.title\n });\n }\n }, [props.item, props.title, props.onClick]);\n React.useEffect(function () {\n if (itemRef.current && props.focused) {\n itemRef.current.focus();\n }\n }, [props.focused]);\n return (React.createElement(\"span\", { style: props.style, tabIndex: props.tabIndex, className: classNames('k-actionsheet-item', 'k-cursor-pointer', props.disabled && 'k-disabled', props.className), ref: itemRef, role: \"button\", \"aria-disabled\": props.disabled, onClick: onClick },\n React.createElement(\"span\", { className: \"k-actionsheet-action\" },\n props.icon && React.createElement(\"span\", { className: \"k-icon-wrap\" }, props.icon),\n (props.title || props.description) && (React.createElement(\"span\", { className: \"k-actionsheet-item-text\" },\n props.title && React.createElement(\"span\", { className: \"k-actionsheet-item-title\" }, props.title),\n props.description && React.createElement(\"span\", { className: \"k-actionsheet-item-description\" }, props.description))))));\n};\nActionSheetItem.propTypes = {\n className: PropTypes.string,\n style: PropTypes.object,\n description: PropTypes.string,\n disabled: PropTypes.bool,\n group: PropTypes.oneOf(['top', 'bottom']),\n icon: PropTypes.element,\n title: PropTypes.string\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nexport var headerDisplayName = 'ActionSheetHeader';\n/**\n * The KendoReact ActionSheetHeader component.\n */\nexport var ActionSheetHeader = function (props) {\n return (React.createElement(\"div\", { className: classNames('k-actionsheet-titlebar', props.className) }, props.children));\n};\nActionSheetHeader.propTypes = {\n className: PropTypes.string\n};\n/**\n * @hidden\n */\nActionSheetHeader.displayName = headerDisplayName;\n/**\n * @hidden\n */\nActionSheetHeader.propTypes = {\n children: PropTypes.any\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nexport var footerDisplayName = 'ActionSheetFooter';\n/**\n * The KendoReact ActionSheetFooter component.\n */\nexport var ActionSheetFooter = function (props) {\n return (React.createElement(\"div\", { className: classNames('k-actionsheet-footer', props.className) }, props.children));\n};\nActionSheetFooter.propTypes = {\n className: PropTypes.string\n};\n/**\n * @hidden\n */\nActionSheetFooter.displayName = footerDisplayName;\n/**\n * @hidden\n */\nActionSheetFooter.propTypes = {\n children: PropTypes.any\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nexport var contentDisplayName = 'ActionSheetContent';\n/**\n * The KendoReact ActionSheetContent component.\n */\nexport var ActionSheetContent = function (props) {\n return (React.createElement(\"div\", { className: classNames('k-actionsheet-content', props.className) }, props.children));\n};\nActionSheetContent.propTypes = {\n className: PropTypes.string\n};\n/**\n * @hidden\n */\nActionSheetContent.displayName = contentDisplayName;\n/**\n * @hidden\n */\nActionSheetContent.propTypes = {\n children: PropTypes.any\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Animation } from '@progress/kendo-react-animation';\nimport { validatePackage, Navigation, FOCUSABLE_ELEMENTS, classNames } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport { ActionSheetItem } from './ActionSheetItem';\nimport { headerDisplayName } from './ActionSheetHeader';\nimport { footerDisplayName } from './ActionSheetFooter';\nimport { contentDisplayName } from './ActionSheetContent';\n/**\n * Represents the [KendoReact ActionSheet]({% slug overview_actionsheet %}) component.\n */\nvar ActionSheet = /** @class */ (function (_super) {\n __extends(ActionSheet, _super);\n /** @hidden */\n function ActionSheet(props) {\n var _this = _super.call(this, props) || this;\n _this.actionSheetRef = React.createRef();\n _this.actionSheetTitleClass = 'k-actionsheet-title';\n _this.ariaLabeledBy = _this.actionSheetTitleClass + 1;\n _this.animationDuration = 300;\n _this.bottomPosition = { bottom: '0', width: '100%' };\n _this.handleKeyDown = function (e) {\n if (_this.props.navigatable) {\n _this.navigation.triggerKeyboardEvent(e);\n }\n };\n _this.onTab = function (target, nav, ev) {\n ev.preventDefault();\n if (ev.shiftKey) {\n nav.focusPrevious(target);\n }\n else {\n nav.focusNext(target);\n }\n };\n _this.handleOverlayClick = function (ev) {\n /** Deprecated */\n if (_this.props.onOverlayClick) {\n _this.props.onOverlayClick.call(undefined, ev);\n }\n if (_this.props.onClose) {\n _this.props.onClose.call(undefined, ev);\n }\n if (!_this.props.animation) {\n _this.hideActionSheet();\n }\n };\n _this.handleItemClick = function (ev) {\n /** Deprecated */\n if (_this.props.onItemClick) {\n _this.props.onItemClick.call(undefined, ev);\n }\n if (_this.props.onItemSelect) {\n _this.props.onItemSelect.call(undefined, ev);\n }\n if (!_this.props.animation) {\n _this.hideActionSheet();\n }\n };\n _this.onEnter = function (target, nav, ev) {\n if (target.ariaDisabled) {\n return;\n }\n var isItem = target.className && target.className.indexOf\n ? target.className.indexOf('k-actionsheet-item') !== -1\n : false;\n var allItems = nav.elements.filter(function (e) { return e.className.indexOf('k-actionsheet-item') !== -1; });\n /** Deprecated */\n if (isItem && _this.props.onItemClick) {\n ev.preventDefault();\n var item = _this.props.items[allItems.indexOf(target)];\n _this.props.onItemClick.call(undefined, {\n syntheticEvent: ev,\n item: item,\n title: item && item.title\n });\n }\n if (isItem && _this.props.onItemSelect) {\n ev.preventDefault();\n var item = _this.props.items[allItems.indexOf(target)];\n _this.props.onItemSelect.call(undefined, {\n syntheticEvent: ev,\n item: item,\n title: item && item.title\n });\n }\n if (!_this.props.animation) {\n _this.hideActionSheet();\n }\n };\n _this.onEscape = function (_target, _nav, ev) {\n /** Deprecated */\n if (_this.props.onOverlayClick) {\n ev.preventDefault();\n _this.props.onOverlayClick.call(undefined, ev);\n }\n if (_this.props.onClose) {\n ev.preventDefault();\n _this.props.onClose.call(undefined, ev);\n }\n if (!_this.props.animation) {\n _this.hideActionSheet();\n }\n };\n _this.hideActionSheet = function () {\n _this.setState({ show: false });\n };\n _this.children = function (children) {\n var components = {};\n React.Children.forEach(children, function (child) {\n if (child) {\n components[child.type.displayName] = child;\n }\n ;\n });\n return components;\n };\n _this.state = {\n show: false,\n slide: false\n };\n validatePackage(packageMetadata);\n return _this;\n }\n /** @hidden */\n ActionSheet.prototype.componentDidMount = function () {\n if (this.props.expand && !this.state.show) {\n this.setState({ show: true });\n }\n };\n /** @hidden */\n ActionSheet.prototype.componentDidUpdate = function (_prevProps, prevState) {\n var _this = this;\n var currentRef = this.actionSheetRef.current;\n if (this.props.expand && !this.state.show) {\n this.setState({ show: true });\n }\n if (this.props.expand && this.state.show && !this.state.slide) {\n this.setState({ slide: true });\n }\n if (!this.props.expand && this.state.show && this.state.slide) {\n this.setState({ slide: false });\n }\n if (prevState !== this.state && this.state.slide && currentRef && !this.props.className) {\n currentRef.style.setProperty('--kendo-actionsheet-height', 'auto');\n currentRef.style.setProperty('--kendo-actionsheet-max-height', 'none');\n }\n if (currentRef) {\n if (this.props.navigatable) {\n var innerElements = [\n '.k-actionsheet-footer',\n '.k-actionsheet-content',\n '.k-actionsheet-titlebar'\n ].map(function (selector) {\n return FOCUSABLE_ELEMENTS.concat(_this.props.navigatableElements).map(function (focusableSelector) { return \"\".concat(selector, \" \").concat(focusableSelector); });\n });\n var selectors = __spreadArray([\n '.k-actionsheet-item'\n ], innerElements.flat(), true);\n this.navigation = new Navigation({\n tabIndex: this.props.tabIndex || 0,\n root: this.actionSheetRef,\n rovingTabIndex: false,\n selectors: selectors,\n keyboardEvents: {\n keydown: {\n 'Tab': this.onTab,\n 'Enter': this.onEnter,\n 'Escape': this.onEscape\n }\n }\n });\n this.navigation.focusElement(this.navigation.first, null);\n }\n }\n };\n ;\n /** @hidden */\n ActionSheet.prototype.render = function () {\n var _this = this;\n var _a = this.props, title = _a.title, subTitle = _a.subTitle, animationStyles = _a.animationStyles, animation = _a.animation, expand = _a.expand, tabIndex = _a.tabIndex, items = _a.items;\n var topGroupItems = items === null || items === void 0 ? void 0 : items.filter(function (item) { return !item.group || item.group === 'top'; });\n var bottomGroupItems = items === null || items === void 0 ? void 0 : items.filter(function (item) { return item.group === 'bottom'; });\n var shouldRenderSeparator = (topGroupItems && topGroupItems.length > 0) && (bottomGroupItems && bottomGroupItems.length > 0);\n var children = this.children(this.props.children);\n var animationDuration = this.props.animationDuration || this.animationDuration;\n var actionSheetPanel = this.state.slide && React.createElement(\"div\", { className: classNames('k-actionsheet', this.props.className, {\n 'k-actionsheet-bottom': !this.props.className\n }), role: \"dialog\", \"aria-modal\": \"true\", \"aria-hidden\": false, \"aria-labelledby\": this.ariaLabeledBy, ref: this.actionSheetRef, onKeyDown: this.handleKeyDown },\n (children[headerDisplayName] && !title && !subTitle) && children[headerDisplayName],\n (title || subTitle) && (React.createElement(\"div\", { className: \"k-actionsheet-titlebar k-text-center\" },\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-hbox\" },\n React.createElement(\"div\", { className: this.actionSheetTitleClass, id: this.ariaLabeledBy },\n title && React.createElement(\"div\", null, title),\n subTitle && React.createElement(\"div\", { className: \"k-actionsheet-subtitle\" }, subTitle))))),\n children[contentDisplayName] || React.createElement(\"div\", { className: \"k-actionsheet-content\" },\n React.createElement(\"div\", { className: \"k-list-ul\", role: \"group\" }, topGroupItems && topGroupItems.map(function (item, idx) {\n return (React.createElement(ActionSheetItem, __assign({}, item, { id: idx, key: idx, item: item, tabIndex: tabIndex || 0, onClick: _this.handleItemClick })));\n })),\n shouldRenderSeparator && React.createElement(\"hr\", { className: \"k-hr\" }),\n React.createElement(\"div\", { className: \"k-list-ul\", role: \"group\" }, bottomGroupItems && bottomGroupItems.map(function (item, idx) {\n return (React.createElement(ActionSheetItem, __assign({}, item, { id: idx + ((topGroupItems === null || topGroupItems === void 0 ? void 0 : topGroupItems.length) || 0), key: idx, item: item, tabIndex: tabIndex || 0, onClick: _this.handleItemClick })));\n }))),\n children[footerDisplayName]);\n return (React.createElement(React.Fragment, null, expand || this.state.show ? (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"k-actionsheet-container\" },\n React.createElement(\"div\", { className: \"k-overlay\", onClick: this.handleOverlayClick }),\n animation ? React.createElement(Animation, { transitionName: this.state.slide ? 'slide-up' : 'slide-down', onExited: this.hideActionSheet, transitionEnterDuration: animationDuration, transitionExitDuration: animationDuration, animationEnteringStyle: animationStyles || this.bottomPosition, animationEnteredStyle: animationStyles || this.bottomPosition, animationExitingStyle: animationStyles || this.bottomPosition, exit: true, enter: true, appear: false }, actionSheetPanel)\n : actionSheetPanel)))\n : null));\n };\n ;\n /** @hidden */\n ActionSheet.displayName = 'KendoReactActionSheet';\n /** @hidden */\n ActionSheet.propTypes = {\n items: PropTypes.array,\n subTitle: PropTypes.string,\n title: PropTypes.string,\n navigatable: PropTypes.bool,\n navigatableElements: PropTypes.array\n };\n /** @hidden */\n ActionSheet.defaultProps = {\n navigatable: true,\n navigatableElements: []\n };\n return ActionSheet;\n}(React.Component));\nexport { ActionSheet };\n;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, Keys, getTabIndex, createPropsContext, withPropsContext, kendoThemeMaps, IconWrap, svgIconPropType, guid } from '@progress/kendo-react-common';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { caretAltDownIcon, xIcon } from '@progress/kendo-svg-icons';\nimport ListContainer from '../common/ListContainer';\nimport ListFilter from '../common/ListFilter';\nimport GroupStickyHeader from '../common/GroupStickyHeader';\nimport ListDefaultItem from '../common/ListDefaultItem';\nimport List from '../common/List';\nimport DropDownBase from '../common/DropDownBase';\nimport { isPresent, getItemValue, sameCharsOnly, shuffleData, matchText, areSame, itemIndexStartsWith } from '../common/utils';\nimport { validatePackage, canUseDOM } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { provideLocalizationService } from '@progress/kendo-react-intl';\nimport { dropDownListArrowBtnAriaLabel, messages } from '../messages';\nimport { MOBILE_SMALL_DEVISE, MOBILE_MEDIUM_DEVISE } from '../common/constants';\nimport { ActionSheet, ActionSheetContent, ActionSheetHeader } from '@progress/kendo-react-layout';\nvar VALIDATION_MESSAGE = 'Please select a value from the list!';\nvar sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;\n/**\n * @hidden\n */\nvar DropDownListWithoutContext = /** @class */ (function (_super) {\n __extends(DropDownListWithoutContext, _super);\n function DropDownListWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /**\n * @hidden\n */\n _this.state = {};\n _this._element = null;\n _this.base = new DropDownBase(_this);\n _this.searchState = { word: '', last: '' };\n _this._select = null;\n _this._skipFocusEvent = false;\n _this._filterInput = null;\n _this._navigated = false;\n _this._lastKeypressIsFilter = false;\n _this._inputId = guid();\n _this.itemHeight = 0;\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this.base.wrapper) {\n _this.base.wrapper.focus();\n }\n };\n /**\n * @hidden\n */\n _this.handleItemSelect = function (index, state) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual, dataItemKey = _a.dataItemKey, defaultItem = _a.defaultItem;\n var skip = virtual ? virtual.skip : 0;\n var item = (index === -1 && defaultItem !== undefined) ?\n defaultItem : data[index - skip];\n var newSelected = !areSame(item, _this.value, dataItemKey);\n _this.triggerOnChange(item, state);\n if (newSelected) {\n _this.base.triggerPageChangeCornerItems(item, state);\n }\n };\n _this.componentRef = function (element) {\n _this._element = element;\n _this.base.wrapper = element;\n };\n _this.dummySelect = function (value) {\n /* Dummy component to support forms */\n return (React.createElement(\"select\", { name: _this.props.name, ref: function (el) { _this._select = el; }, tabIndex: -1, \"aria-hidden\": true, title: _this.props.label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },\n React.createElement(\"option\", { value: _this.props.valueMap ? _this.props.valueMap.call(undefined, value) : value })));\n };\n _this.renderListContainer = function () {\n var _a;\n var _b = _this.props, header = _b.header, footer = _b.footer, dir = _b.dir, _c = _b.data, data = _c === void 0 ? [] : _c, size = _b.size, groupField = _b.groupField, groupStickyHeaderItemRender = _b.groupStickyHeaderItemRender, list = _b.list;\n var base = _this.base;\n var popupSettings = base.getPopupSettings();\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;\n var listContainerProps = {\n dir: dir !== undefined ? dir : base.dirCalculated,\n width: popupWidth,\n popupSettings: {\n popupClass: classNames(popupSettings.popupClass, 'k-list-container', 'k-dropdownlist-popup'),\n className: popupSettings.className,\n animate: popupSettings.animate,\n anchor: _this.element,\n show: opened,\n onOpen: _this.onPopupOpened,\n onClose: _this.onPopupClosed,\n appendTo: popupSettings.appendTo\n },\n itemsCount: [data.length]\n };\n var group = _this.state.group;\n if (group === undefined && groupField !== undefined) {\n group = getItemValue(data[0], groupField);\n }\n return (React.createElement(ListContainer, __assign({}, listContainerProps),\n _this.renderListFilter(),\n header && React.createElement(\"div\", { className: \"k-list-header\" }, header),\n React.createElement(\"div\", { className: classNames('k-list', (_a = {}, _a[\"k-list-\".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = _this.base.vs.enabled, _a)) },\n _this.renderDefaultItem(),\n !list && group && data.length !== 0 && React.createElement(GroupStickyHeader, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),\n _this.renderList()),\n footer && React.createElement(\"div\", { className: \"k-list-footer\" }, footer)));\n };\n _this.renderList = function () {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, groupHeaderItemRender = _a.groupHeaderItemRender, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;\n var vs = _this.base.vs;\n var skip = virtual.skip;\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var popupSettings = _this.base.getPopupSettings();\n var translate = \"translateY(\".concat(vs.translate, \"px)\");\n return (React.createElement(List, { id: _this.base.listBoxId, show: opened, data: data.slice(), focusedIndex: _this.getFocusedIndex(), value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, groupField: _this.props.groupField, groupMode: 'modern', listRef: function (list) { return vs.list = _this.base.list = list; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: \"k-list-content\", listStyle: vs.enabled ? { transform: translate } : undefined, key: \"listkey\", skip: skip, onClick: _this.handleItemClick, itemRender: itemRender, groupHeaderItemRender: groupHeaderItemRender, noDataRender: listNoDataRender, onScroll: _this.onScroll, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));\n };\n _this.onScroll = function (event) {\n var _a = _this.base, vs = _a.vs, list = _a.list;\n vs.scrollHandler(event);\n var groupField = _this.props.groupField;\n var _b = _this.props.data, data = _b === void 0 ? [] : _b;\n if (!groupField || !data.length) {\n return;\n }\n if (groupField) {\n var itemHeight = _this.itemHeight =\n _this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));\n var target = event.target;\n var scrollTop = target.scrollTop - (vs.skip * itemHeight);\n data = _this.base.getGroupedDataModernMode(data, groupField);\n var group = data[0][groupField];\n for (var i = 1; i < data.length; i++) {\n if (itemHeight * i > scrollTop) {\n break;\n }\n if (data[i] && data[i][groupField]) {\n group = data[i][groupField];\n }\n }\n if (group !== _this.state.group) {\n _this.setState({\n group: group\n });\n }\n }\n };\n _this.renderListFilter = function () {\n var filterText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n return _this.props.filterable && (React.createElement(ListFilter, { value: filterText, ref: function (filter) { return _this._filterInput = filter && filter.element; }, onChange: _this.handleListFilterChange, onKeyDown: _this.handleKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode }));\n };\n _this.renderDefaultItem = function () {\n var _a = _this.props, textField = _a.textField, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey;\n return defaultItem !== undefined && (React.createElement(ListDefaultItem, { defaultItem: defaultItem, textField: textField, selected: areSame(_this.value, defaultItem, dataItemKey), key: \"defaultitemkey\", onClick: _this.handleDefaultItemClick }));\n };\n _this.search = function (event) {\n clearTimeout(_this._typingTimeout);\n if (!_this.props.filterable) {\n _this._typingTimeout = window.setTimeout(function () { return _this.searchState.word = ''; }, _this.props.delay);\n _this.selectNext(event);\n }\n };\n _this.selectNext = function (event) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey;\n var mappedData = data.map(function (item, idx) {\n return { item: item, itemIndex: idx };\n });\n var word = _this.searchState.word;\n var last = _this.searchState.last;\n var isInLoop = sameCharsOnly(word, last);\n var dataLength = mappedData.length;\n var startIndex = Math.max(0, data.findIndex(function (i) { return areSame(i, _this.value, dataItemKey); }));\n var defaultItem;\n if (_this.props.defaultItem) {\n defaultItem = { item: _this.props.defaultItem, itemIndex: -1 };\n dataLength += 1;\n startIndex += 1;\n }\n startIndex += isInLoop ? 1 : 0;\n mappedData = shuffleData(mappedData, startIndex, defaultItem);\n var text, loopMatch, nextMatch, index = 0;\n var _c = _this.props, textField = _c.textField, ignoreCase = _c.ignoreCase;\n for (; index < dataLength; index++) {\n text = getItemValue(mappedData[index].item, textField);\n loopMatch = isInLoop && matchText(text, last, ignoreCase);\n nextMatch = matchText(text, word, ignoreCase);\n if (loopMatch || nextMatch) {\n index = mappedData[index].itemIndex;\n break;\n }\n }\n if (index !== dataLength) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n _this.handleItemSelect(index, state);\n _this.applyState(state);\n _this._valueDuringOnChange = undefined;\n }\n };\n _this.handleKeyDown = function (event) {\n // The following added here to prevent the propagation of the keyDown event when the filter prop is set to true\n event && event.stopPropagation && event.stopPropagation();\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, filterable = _a.filterable, disabled = _a.disabled, defaultItem = _a.defaultItem, _c = _a.leftRightKeysNavigation, leftRightKeysNavigation = _c === void 0 ? true : _c, _d = _a.virtual, virtual = _d === void 0 ? { skip: 0, total: 0, pageSize: 0 } : _d, dataItemKey = _a.dataItemKey, _e = _a.groupField, groupField = _e === void 0 ? '' : _e, textField = _a.textField, _f = _a.skipDisabledItems, skipDisabledItems = _f === void 0 ? true : _f;\n var value = _this.value;\n var selectedIndex = data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var keyCode = event.keyCode;\n var homeOrEndKeys = keyCode === Keys.home || keyCode === Keys.end;\n var upOrDownKeys = keyCode === Keys.up || keyCode === Keys.down;\n var shouldOpen = !opened &&\n ((event.altKey && keyCode === Keys.down) || keyCode === Keys.enter || keyCode === Keys.space);\n var shouldClose = opened && ((event.altKey && keyCode === Keys.up) || keyCode === Keys.esc);\n var leftOrRightKeys = leftRightKeysNavigation && (keyCode === Keys.left || keyCode === Keys.right);\n var shouldNavigate = upOrDownKeys || (leftOrRightKeys && !filterable) || homeOrEndKeys;\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (disabled) {\n return;\n }\n else if (homeOrEndKeys && _this.base.vs.enabled) {\n if (keyCode === Keys.home) {\n if (virtual.skip !== 0) {\n _this.base.triggerOnPageChange(state, 0, virtual.pageSize);\n _this._navigated = true;\n }\n else {\n _this.triggerOnChange(data[0], state);\n }\n }\n else {\n if (virtual.skip < virtual.total - virtual.pageSize) {\n _this.base.triggerOnPageChange(state, virtual.total - virtual.pageSize, virtual.pageSize);\n _this._navigated = true;\n }\n else {\n _this.triggerOnChange(data[data.length - 1], state);\n }\n }\n }\n else if (opened && keyCode === Keys.pageUp) {\n _this.base.scrollPopupByPageSize(-1);\n }\n else if (opened && keyCode === Keys.pageDown) {\n _this.base.scrollPopupByPageSize(1);\n }\n else if (opened && keyCode === Keys.enter) {\n var focusedIndex = _this.getFocusedIndex();\n if (_this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {\n _this.triggerOnChange(null, state);\n _this.applyState(state);\n }\n else {\n _this.handleItemSelect(focusedIndex, state);\n }\n _this.base.togglePopup(state);\n event.preventDefault();\n }\n else if (shouldOpen || shouldClose) {\n if (shouldClose) {\n _this.resetValueIfDisabledItem();\n }\n _this.base.togglePopup(state);\n event.preventDefault();\n }\n else if (shouldNavigate) {\n _this._lastKeypressIsFilter = false;\n if (groupField !== '' && textField) {\n if (!skipDisabledItems && opened) {\n _this.onNavigate(state, keyCode);\n }\n else {\n var newIndex = undefined;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n var tempnewIndex_1 = data.slice(selectedIndex + 1).find(function (i) { return !i.disabled && i[textField]; });\n newIndex = tempnewIndex_1 && data.findIndex(function (el) { return el[textField] === tempnewIndex_1[textField]; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataToSearch = void 0;\n if (selectedIndex === 0 && defaultItem) {\n newIndex = -1;\n }\n else if (selectedIndex === -1) {\n dataToSearch = data;\n newIndex = data.findIndex(function (i) { return !i.disabled && i[textField]; });\n }\n else {\n dataToSearch = data.slice(0, selectedIndex);\n var tempnewIndex_2 = dataToSearch.pop();\n while (tempnewIndex_2 && tempnewIndex_2.disabled) {\n tempnewIndex_2 = dataToSearch.pop();\n }\n newIndex = tempnewIndex_2 && data.findIndex(function (el) { return el[textField] === tempnewIndex_2[textField]; });\n }\n }\n if (newIndex !== undefined) {\n var skipItems = newIndex - selectedIndex;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else if (newIndex === undefined && data.findIndex(function (el) { return el[textField] === value[textField]; }) === data.length - 1) {\n _this.onNavigate(state, keyCode);\n }\n }\n }\n else if (!skipDisabledItems && opened || homeOrEndKeys) {\n _this.onNavigate(state, keyCode);\n }\n else if (textField) {\n var newIndex = undefined;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n var tempnewIndex_3 = data.slice(selectedIndex + 1).find(function (i) { return !i.disabled && i[textField]; });\n newIndex = tempnewIndex_3 && data.findIndex(function (el) { return el[textField] === tempnewIndex_3[textField]; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataTest = void 0;\n if (selectedIndex === 0 && defaultItem) {\n newIndex = -1;\n }\n else if (selectedIndex === -1) {\n dataTest = data;\n newIndex = data.find(function (i) { return !i.disabled && i[textField]; });\n }\n else {\n dataTest = data.slice(0, selectedIndex);\n var tempnewIndex_4 = dataTest.pop();\n while (tempnewIndex_4 && tempnewIndex_4.disabled) {\n tempnewIndex_4 = dataTest.pop();\n }\n newIndex = tempnewIndex_4 && data.findIndex(function (el) { return el[textField] === tempnewIndex_4[textField]; });\n }\n }\n if (newIndex !== undefined) {\n var skipItems = newIndex - selectedIndex;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else if (newIndex === undefined && data.findIndex(function (el) { return el[textField] === value[textField]; }) === data.length - 1) {\n _this.onNavigate(state, keyCode);\n }\n }\n else {\n _this.onNavigate(state, keyCode);\n }\n event.preventDefault();\n }\n _this.applyState(state);\n };\n _this.handleItemClick = function (index, event) {\n _this.base.handleItemClick(index, event);\n _this._valueDuringOnChange = undefined;\n };\n _this.handleFocus = function (event) {\n if (_this._skipFocusEvent) {\n return;\n }\n _this.base.handleFocus(event);\n };\n _this.handleBlur = function (event) {\n if (_this._skipFocusEvent || !_this.state.focused) {\n return;\n }\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var adaptive = _this.props.adaptive;\n var _a = _this.state.windowWidth, windowWidth = _a === void 0 ? 0 : _a;\n var renderAdaptive = windowWidth <= MOBILE_MEDIUM_DEVISE && adaptive;\n var state = _this.base.initState();\n state.syntheticEvent = event;\n state.data.focused = false;\n state.events.push({ type: 'onBlur' });\n if (opened) {\n _this.resetValueIfDisabledItem();\n }\n if (opened && !renderAdaptive) {\n _this.base.togglePopup(state);\n }\n _this.applyState(state);\n };\n _this.handleDefaultItemClick = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n _this.base.togglePopup(state);\n _this.triggerOnChange(_this.props.defaultItem, state);\n _this.applyState(state);\n };\n _this.handleWrapperClick = function (event) {\n if (event.isPropagationStopped()) {\n return;\n }\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (!_this.state.focused) {\n state.data.focused = true;\n }\n _this.resetValueIfDisabledItem();\n _this.base.togglePopup(state);\n _this.applyState(state);\n };\n _this.handleKeyPress = function (event) {\n if (_this.props.filterable || event.which === 0 || event.keyCode === Keys.enter) {\n return;\n }\n var character = String.fromCharCode(event.charCode || event.keyCode);\n if (_this.props.ignoreCase) {\n character = character.toLowerCase();\n }\n if (character === ' ') {\n event.preventDefault();\n }\n _this.searchState = {\n word: _this.searchState.word + character,\n last: _this.searchState.last + character\n };\n _this.search(event);\n };\n _this.handleListFilterChange = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event.syntheticEvent;\n if (_this.props.filter === undefined) {\n state.data.text = event.target.value;\n }\n _this.base.filterChanged(event.target.value, state);\n _this._lastKeypressIsFilter = true;\n _this.applyState(state);\n _this.setState({ group: undefined });\n };\n _this.onPopupOpened = function () {\n if (_this._filterInput) {\n _this.focusElement(_this._filterInput);\n }\n if (_this.props.adaptive) {\n setTimeout(function () {\n if (_this._filterInput) {\n _this.focusElement(_this._filterInput);\n }\n }, 300);\n }\n };\n _this.onPopupClosed = function () {\n if (_this.state.focused) {\n window.setTimeout(function () {\n if (_this.state.focused && _this.base.wrapper) {\n _this.focusElement(_this.base.wrapper);\n }\n });\n }\n };\n _this.setValidity = function () {\n if (_this._select && _this._select.setCustomValidity) {\n _this._select.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || VALIDATION_MESSAGE);\n }\n };\n validatePackage(packageMetadata);\n return _this;\n }\n Object.defineProperty(DropDownListWithoutContext.prototype, \"document\", {\n get: function () {\n if (!canUseDOM) {\n return;\n }\n // useful only for user actions\n return (this.element && this.element.ownerDocument) || document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"element\", {\n /**\n * @hidden\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"value\", {\n /**\n * The value of the DropDownList.\n */\n get: function () {\n var value;\n if (this._valueDuringOnChange !== undefined) {\n value = this._valueDuringOnChange;\n }\n else if (this.props.value !== undefined) {\n value = this.props.value;\n }\n else if (this.state.value !== undefined) {\n value = this.state.value;\n }\n else if (this.props.defaultValue !== undefined) {\n value = this.props.defaultValue;\n }\n if (!isPresent(value) && this.props.defaultItem !== undefined) {\n value = this.props.defaultItem;\n }\n return value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"index\", {\n /**\n * The index of the selected item.\n */\n get: function () {\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey;\n var value = this.value;\n // TO DO: deprecate it!\n return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the DropDownList.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the DropDownList is set.\n */\n get: function () {\n var customError = this.props.validationMessage !== undefined;\n var isValid = (!this.required\n || (this.value !== null && this.value !== '' && this.value !== undefined));\n var valid = this.props.valid !== undefined ? this.props.valid : isValid;\n return {\n customError: customError,\n valid: valid,\n valueMissing: this.value === null\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"validityStyles\", {\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : DropDownListWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropDownListWithoutContext.prototype, \"required\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : DropDownListWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n DropDownListWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {\n var _a;\n var _b = this.props, dataItemKey = _b.dataItemKey, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c, textField = _b.textField;\n var _d = this.props.data, data = _d === void 0 ? [] : _d;\n var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;\n var opening = !prevOpened && opened;\n var closing = prevOpened && !opened;\n if (!this.base.getPopupSettings().animate) {\n if (opening) {\n this.onPopupOpened();\n }\n else if (closing) {\n // this.onPopupClosed();\n }\n }\n if (virtual && virtual.total !== prevTotal) {\n this.base.vs.calcScrollElementHeight();\n this.base.vs.reset();\n }\n else {\n var selectedItem_1 = this.value;\n var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;\n var selectedItemIndex = data.findIndex(function (i) { return areSame(i, selectedItem_1, dataItemKey); });\n if (groupField !== '' && selectedItem_1 && textField) {\n selectedItemIndex = (_a = this.base.getGroupedDataModernMode(data, groupField)) === null || _a === void 0 ? void 0 : _a.map(function (el) { return el[textField]; }).indexOf(selectedItem_1[textField]);\n }\n var selectedItemChanged = !areSame(prevSelectedItem, selectedItem_1, dataItemKey);\n if (opening && virtual) {\n this.base.scrollToVirtualItem(virtual, selectedItemIndex);\n }\n else if (opening && !virtual) {\n this.onPopupOpened();\n // Resets the sticky header group value for scenarios with open/close of component's popup\n if (data && data.length !== 0) {\n this.base.resetGroupStickyHeader(data[0][groupField], this);\n }\n this.base.scrollToItem(selectedItemIndex);\n }\n else if (opened && prevOpened && selectedItem_1 && selectedItemChanged && !this._navigated) {\n this.base.scrollToItem(selectedItemIndex);\n }\n else if (opened && prevOpened && this._navigated) {\n if (this._navigated && virtual && virtual.skip === 0) {\n this.base.vs.reset();\n }\n else if (this._navigated && virtual && virtual.skip === virtual.total - virtual.pageSize) {\n this.base.vs.scrollToEnd();\n }\n }\n }\n this._navigated = false;\n this.setValidity();\n };\n /**\n * @hidden\n */\n DropDownListWithoutContext.prototype.componentDidMount = function () {\n var _a;\n this.observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this));\n this.base.didMount();\n this.setValidity();\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.observe(this.document.body);\n }\n };\n /** @hidden */\n DropDownListWithoutContext.prototype.componentWillUnmount = function () {\n var _a;\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.disconnect();\n }\n };\n /**\n * @hidden\n */\n DropDownListWithoutContext.prototype.render = function () {\n var _a;\n var _this = this;\n var btnAriaLabel = provideLocalizationService(this).toLanguageString(dropDownListArrowBtnAriaLabel, messages[dropDownListArrowBtnAriaLabel]);\n var _b = this.props, style = _b.style, className = _b.className, label = _b.label, dir = _b.dir, virtual = _b.virtual, size = _b.size, rounded = _b.rounded, fillMode = _b.fillMode, adaptive = _b.adaptive;\n var _c = this.state.windowWidth, windowWidth = _c === void 0 ? 0 : _c;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var value = this.value;\n var text = getItemValue(value, this.props.textField);\n var isValid = !this.validityStyles || this.validity.valid;\n var base = this.base;\n var vs = base.vs;\n var renderAdaptive = windowWidth <= MOBILE_MEDIUM_DEVISE && adaptive;\n vs.enabled = virtual !== undefined;\n if (virtual !== undefined) {\n base.vs.skip = virtual.skip;\n base.vs.total = virtual.total;\n base.vs.pageSize = virtual.pageSize;\n }\n var _d = this.props, dataItemKey = _d.dataItemKey, _e = _d.data, data = _e === void 0 ? [] : _e, disabled = _d.disabled, tabIndex = _d.tabIndex, loading = _d.loading, iconClassName = _d.iconClassName, valueRender = _d.valueRender;\n var focused = this.state.focused;\n var selectedIndex = data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n var valueDefaultRendering = (React.createElement(\"span\", { id: this._inputId, className: \"k-input-inner\" },\n React.createElement(\"span\", { className: \"k-input-value-text\" }, text)));\n var valueElement = valueRender !== undefined ?\n valueRender.call(undefined, valueDefaultRendering, value) : valueDefaultRendering;\n var dropdownlist = (React.createElement(React.Fragment, null,\n React.createElement(\"span\", { ref: this.componentRef, className: classNames('k-dropdownlist k-picker', className, (_a = {},\n _a[\"k-picker-\".concat(sizeMap[size] || size)] = size,\n _a[\"k-rounded-\".concat(roundedMap[rounded] || rounded)] = rounded,\n _a[\"k-picker-\".concat(fillMode)] = fillMode,\n _a['k-focus'] = focused,\n _a['k-disabled'] = disabled,\n _a['k-invalid'] = !isValid,\n _a['k-loading'] = loading,\n _a['k-required'] = this.required,\n _a)), style: !label\n ? style\n : __assign(__assign({}, style), { width: undefined }), dir: dir, onMouseDown: opened ? function (event) {\n if (event.target.nodeName !== 'INPUT') {\n _this.focusElement(_this.base.wrapper);\n event.preventDefault();\n }\n } : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, tabIndex: getTabIndex(tabIndex, disabled), accessKey: this.props.accessKey, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onClick: disabled ? undefined : this.handleWrapperClick, role: 'combobox', \"aria-required\": this.required, \"aria-disabled\": disabled || undefined, \"aria-haspopup\": 'listbox', \"aria-expanded\": opened || false, \"aria-owns\": this.base.listBoxId, \"aria-activedescendant\": opened ? ('option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0))) : undefined, \"aria-label\": this.props.ariaLabel || this.props.label, \"aria-labelledby\": this.props.ariaLabelledBy, \"aria-describedby\": this.props.ariaDescribedBy || this._inputId, id: this.props.id, title: this.props.title },\n valueElement,\n loading && React.createElement(IconWrap, { className: \"k-input-loading-icon\", name: 'loading' }),\n React.createElement(Button, { tabIndex: -1, type: \"button\", \"aria-label\": btnAriaLabel, \"aria-hidden\": true, size: size, fillMode: fillMode, iconClass: iconClassName, className: \"k-input-button\", rounded: null, themeColor: 'base', icon: !iconClassName ? 'caret-alt-down' : undefined, svgIcon: !iconClassName ? caretAltDownIcon : this.props.svgIcon, onMouseDown: function (e) { return _this.state.focused && e.preventDefault(); } }),\n this.dummySelect(value),\n !renderAdaptive && this.renderListContainer()),\n renderAdaptive && this.renderAdaptiveListContainer()));\n return label ? (React.createElement(FloatingLabel, { label: label, editorValue: text, editorValid: isValid, editorDisabled: this.props.disabled, style: { width: style ? style.width : undefined }, children: dropdownlist })) : dropdownlist;\n };\n /**\n * @hidden\n */\n DropDownListWithoutContext.prototype.onNavigate = function (state, keyCode, skipItems) {\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0, total: 0, pageSize: 0 } : _c;\n var vs = this.base.vs;\n var value = this.value;\n var index = data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n var newIndex = this.base.navigation.navigate({\n current: virtual.skip + index,\n max: (vs.enabled ? virtual.total : data.length) - 1,\n min: defaultItem !== undefined ? -1 : 0,\n keyCode: keyCode,\n skipItems: skipItems ? skipItems : undefined\n });\n if (newIndex !== undefined) {\n this.handleItemSelect(newIndex, state);\n }\n this.applyState(state);\n };\n DropDownListWithoutContext.prototype.renderAdaptiveListContainer = function () {\n var _a;\n var _this = this;\n var _b = this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;\n var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, adaptiveTitle = _c.adaptiveTitle, groupField = _c.groupField, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender, list = _c.list, _d = _c.data, data = _d === void 0 ? [] : _d;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var actionSheetProps = {\n navigatable: false,\n navigatableElements: [],\n expand: opened,\n animation: true,\n onClose: function (event) { return _this.handleWrapperClick(event); },\n animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,\n className: windowWidth <= MOBILE_SMALL_DEVISE\n ? 'k-adaptive-actionsheet k-actionsheet-fullscreen'\n : 'k-adaptive-actionsheet k-actionsheet-bottom'\n };\n var group = this.state.group;\n if (group === undefined && groupField !== undefined) {\n group = getItemValue(data[0], groupField);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(ActionSheet, __assign({}, actionSheetProps),\n React.createElement(ActionSheetHeader, { className: 'k-text-center' },\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-hbox\" },\n React.createElement(\"div\", { className: \"k-actionsheet-title\" },\n React.createElement(\"div\", null, adaptiveTitle)),\n React.createElement(\"div\", { className: \"k-actionsheet-actions\" },\n React.createElement(Button, { tabIndex: 0, \"aria-label\": \"Cancel\", \"aria-disabled\": \"false\", type: \"button\", fillMode: \"flat\", onClick: this.handleWrapperClick, icon: 'x', svgIcon: xIcon }))),\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-actionsheet-filter\" }, this.renderListFilter())),\n React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' },\n header && React.createElement(\"div\", { className: \"k-list-header\" }, header),\n React.createElement(\"div\", { className: classNames('k-list', (_a = {}, _a[\"k-list-\".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)) },\n this.renderDefaultItem(),\n !list && group && data.length !== 0 && React.createElement(GroupStickyHeader, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),\n this.renderList()),\n footer && React.createElement(\"div\", { className: \"k-list-footer\" }, footer)))));\n };\n DropDownListWithoutContext.prototype.getFocusedIndex = function () {\n var value = this.value;\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? itemIndexStartsWith : _d, filterable = _a.filterable, _e = _a.skipDisabledItems, skipDisabledItems = _e === void 0 ? true : _e;\n var text = this.props.filter ? this.props.filter : this.state.text;\n if (skipDisabledItems && textField && !text && !value) {\n return data.findIndex(function (i) { return !i.disabled && i[textField]; });\n }\n else if (isPresent(value) && text === undefined || filterable && text === '') {\n return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n }\n else if (text) {\n if (this._lastKeypressIsFilter) {\n return focusedItemIndex(data, text, textField);\n }\n return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n }\n else {\n return virtual.skip === 0 ? 0 : -1;\n }\n };\n DropDownListWithoutContext.prototype.focusElement = function (element) {\n var _this = this;\n this._skipFocusEvent = true;\n element.focus();\n window.setTimeout(function () { return _this._skipFocusEvent = false; }, 30);\n };\n DropDownListWithoutContext.prototype.triggerOnChange = function (item, state) {\n if (areSame(this.value, item, this.props.dataItemKey)) {\n return;\n }\n if (this.props.value === undefined) {\n state.data.value = item;\n }\n this._valueDuringOnChange = item;\n state.events.push({ type: 'onChange' });\n };\n DropDownListWithoutContext.prototype.applyState = function (state) {\n this.base.applyState(state);\n this._valueDuringOnChange = undefined;\n };\n DropDownListWithoutContext.prototype.calculateMedia = function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n this.setState({ windowWidth: entry.target.clientWidth });\n }\n ;\n };\n ;\n DropDownListWithoutContext.prototype.resetValueIfDisabledItem = function () {\n var _a = this.props.data, data = _a === void 0 ? [] : _a;\n var state = this.base.initState();\n var focusedIndex = this.getFocusedIndex();\n if (this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {\n this.triggerOnChange(null, state);\n this.applyState(state);\n }\n };\n DropDownListWithoutContext.prototype.haveFocusedItemAndDataNotEmpty = function (data, focusedIndex) {\n return focusedIndex !== undefined && focusedIndex !== -1 && data && data.length > 0 && data[focusedIndex].disabled;\n };\n DropDownListWithoutContext.displayName = 'DropDownList';\n /**\n * @hidden\n */\n DropDownListWithoutContext.propTypes = __assign({ delay: PropTypes.number, ignoreCase: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: svgIconPropType, defaultItem: PropTypes.any, valueRender: PropTypes.func, valueMap: PropTypes.func, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, ariaLabel: PropTypes.string, leftRightKeysNavigation: PropTypes.bool, title: PropTypes.string, groupField: PropTypes.string, list: PropTypes.any, skipDisabledItems: PropTypes.bool }, DropDownBase.propTypes);\n /**\n * @hidden\n */\n DropDownListWithoutContext.defaultProps = __assign(__assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase.defaultProps), { required: false, size: 'medium', rounded: 'medium', fillMode: 'solid', groupMode: 'modern' });\n return DropDownListWithoutContext;\n}(React.Component));\nexport { DropDownListWithoutContext };\n/**\n * Represents the PropsContext of the `DropDownList` component.\n * Used for global configuration of all `DropDownList` instances.\n *\n * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.\n */\nexport var DropDownListPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).\n *\n * Accepts properties of type [DropDownListProps]({% slug api_dropdowns_dropdownlistprops %}).\n * Obtaining the `ref` returns an object of type [DropDownListHandle]({% slug api_dropdowns_dropdownlisthandle %}).\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * dropdownlist = null;\n * render() {\n * return (\n *
\n * this.dropdownlist = component}\n * />\n * \n *
\n * );\n * }\n * }\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var DropDownList = withPropsContext(DropDownListPropsContext, DropDownListWithoutContext);\nDropDownList.displayName = 'KendoReactDropDownList';\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { getActiveElement } from '@progress/kendo-react-common';\nimport * as React from 'react';\n/**\n * @hidden\n */\nvar SearchBar = /** @class */ (function (_super) {\n __extends(SearchBar, _super);\n function SearchBar() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._input = null;\n return _this;\n }\n Object.defineProperty(SearchBar.prototype, \"input\", {\n /**\n * @hidden\n */\n get: function () {\n return this._input;\n },\n enumerable: false,\n configurable: true\n });\n SearchBar.prototype.componentDidUpdate = function (prevProps) {\n var prevValue = prevProps.value;\n var prevSuggestedText = prevProps.suggestedText;\n var _a = this.props, value = _a.value, suggestedText = _a.suggestedText, focused = _a.focused;\n var input = this.input;\n var valueChanged = prevValue !== value || suggestedText !== prevSuggestedText;\n var deleting = valueChanged && prevValue.startsWith(value) &&\n !(prevSuggestedText && suggestedText && prevSuggestedText.endsWith(suggestedText));\n var activeElement = getActiveElement(document);\n if (focused && input && activeElement !== input) {\n input.focus();\n }\n if (suggestedText && valueChanged && !deleting && input) {\n input.setSelectionRange(value.length - suggestedText.length, value.length);\n }\n };\n SearchBar.prototype.render = function () {\n var _this = this;\n var _a = this.props, _b = _a.expanded, expanded = _b === void 0 ? false : _b, disabled = _a.disabled, _c = _a.role, role = _c === void 0 ? 'listbox' : _c, render = _a.render;\n var searchbar = (React.createElement(\"input\", { autoComplete: \"off\", id: this.props.id, type: \"text\", key: \"searchbar\", size: this.props.size, placeholder: this.props.placeholder, className: \"k-input-inner\", tabIndex: this.props.tabIndex, accessKey: this.props.accessKey, role: role, name: this.props.name, value: this.props.value, onChange: this.props.onChange, ref: function (input) { return _this._input = input; }, onKeyDown: this.props.onKeyDown, onFocus: this.props.onFocus, onBlur: this.props.onBlur, onClick: this.props.onClick, \"aria-disabled\": disabled || undefined, disabled: disabled || undefined, readOnly: this.props.readOnly || undefined, title: this.props.title, \"aria-haspopup\": \"listbox\", \"aria-expanded\": expanded, \"aria-owns\": this.props.owns, \"aria-activedescendant\": expanded ? this.props.activedescendant : undefined, \"aria-describedby\": this.props.ariaDescribedBy, \"aria-labelledby\": this.props.ariaLabelledBy, \"aria-required\": this.props.ariaRequired }));\n return render ? render.call(undefined, searchbar) : searchbar;\n };\n return SearchBar;\n}(React.Component));\nexport default SearchBar;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { messages, clear } from '../messages';\nimport { IconWrap } from '@progress/kendo-react-common';\nimport { xIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nvar ClearButton = /** @class */ (function (_super) {\n __extends(ClearButton, _super);\n function ClearButton() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onMouseDown = function (e) { return e.preventDefault(); };\n return _this;\n }\n ClearButton.prototype.render = function () {\n var title = provideLocalizationService(this).toLanguageString(clear, messages[clear]);\n return (React.createElement(\"span\", { className: \"k-clear-value\", role: \"button\", onClick: this.props.onClick, onMouseDown: this.onMouseDown, tabIndex: -1, title: title, key: \"clearbutton\" },\n React.createElement(IconWrap, { name: 'x', icon: xIcon })));\n };\n return ClearButton;\n}(React.Component));\nexport default ClearButton;\nregisterForLocalization(ClearButton);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport DropDownBase from '../common/DropDownBase';\nimport { guid, classNames, Keys, createPropsContext, withPropsContext, kendoThemeMaps, svgIconPropType } from '@progress/kendo-react-common';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { areSame, itemIndexStartsWith, getItemIndexByText, getItemValue, isPresent, suggestValue } from '../common/utils';\nimport SearchBar from '../common/SearchBar';\nimport ListContainer from '../common/ListContainer';\nimport List from '../common/List';\nimport ListFilter from '../common/ListFilter';\nimport GroupStickyHeader from '../common/GroupStickyHeader';\nimport { validatePackage, canUseDOM, IconWrap } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport ClearButton from '../common/ClearButton';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { caretAltDownIcon, xIcon } from '@progress/kendo-svg-icons';\nimport { messages, comboArrowBtnAriaLabelExpand, comboArrowBtnAriaLabelCollapse } from './../messages';\nimport { provideLocalizationService } from '@progress/kendo-react-intl';\nimport { ActionSheet, ActionSheetContent, ActionSheetHeader } from '@progress/kendo-react-layout';\nimport { MOBILE_SMALL_DEVISE, MOBILE_MEDIUM_DEVISE } from '../common/constants';\nvar VALIDATION_MESSAGE = 'Please enter a valid value!';\nvar sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;\n/** @hidden */\nvar ComboBoxWithoutContext = /** @class */ (function (_super) {\n __extends(ComboBoxWithoutContext, _super);\n function ComboBoxWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /** @hidden */\n _this.state = {};\n _this.base = new DropDownBase(_this);\n _this._element = null;\n _this._inputId = guid();\n _this._suggested = '';\n _this._skipBlur = false;\n _this._input = null;\n _this._adaptiveFilterInput = null;\n _this.itemHeight = 0;\n /** @hidden */\n _this.focus = function () {\n if (_this._input) {\n _this._input.focus();\n }\n };\n /** @hidden */\n _this.handleItemSelect = function (index, state) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual, dataItemKey = _a.dataItemKey;\n var skip = virtual ? virtual.skip : 0;\n var item = data[index - skip];\n var newSelected = !areSame(item, _this.value, dataItemKey);\n _this.triggerOnChange(item, state);\n if (_this.state.text !== undefined) {\n state.data.text = undefined;\n }\n if (newSelected) {\n _this.base.triggerPageChangeCornerItems(item, state);\n }\n };\n _this.onPopupOpened = function () {\n setTimeout(function () {\n if (_this.mobileMode && _this._adaptiveFilterInput) {\n _this._skipBlur = true;\n _this._adaptiveFilterInput.focus();\n _this._skipBlur = false;\n }\n }, 300);\n };\n _this.componentRef = function (element) {\n _this._element = element;\n _this.base.wrapper = element;\n };\n _this.toggleBtnClick = function (event) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, skipDisabledItems = _a.skipDisabledItems, textField = _a.textField;\n var focusedIndex = _this.getFocusedIndex();\n var isCurrentValueDisabled = _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (!skipDisabledItems && textField && isCurrentValueDisabled) {\n _this.clearValueOnToggleBtnClick(event);\n }\n _this.base.togglePopup(state);\n if (!opened && _this.mobileMode) {\n var mobileText = _this.props.adaptiveFilter !== undefined ? _this.props.adaptiveFilter : _this.state.text || null;\n _this.base.filterChanged(mobileText, state);\n }\n _this.applyState(state);\n };\n _this.renderMobileListFilter = function () {\n var mobileText = _this.props.adaptiveFilter !== undefined ? _this.props.adaptiveFilter : _this.state.text;\n var selectedItemText = getItemValue(_this.value, _this.props.textField);\n var mobileInputText = isPresent(mobileText) ? mobileText : selectedItemText;\n return (React.createElement(ListFilter, { value: mobileInputText, ref: function (filter) { return _this._adaptiveFilterInput = filter && filter.element; }, onChange: _this.handleMobileFilterChange, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode }));\n };\n _this.handleMobileFilterChange = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event.syntheticEvent;\n state.data.text = event.target.value;\n _this.base.filterChanged(event.target.value, state);\n _this.applyState(state);\n };\n _this.onScroll = function (event) {\n var _a = _this.base, vs = _a.vs, list = _a.list;\n vs.scrollHandler(event);\n var groupField = _this.props.groupField;\n var _b = _this.props.data, data = _b === void 0 ? [] : _b;\n if (!groupField || !data.length) {\n return;\n }\n var itemHeight = _this.itemHeight =\n _this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));\n var target = event.target;\n var scrollTop = target.scrollTop - (vs.skip * itemHeight);\n if (_this.props.groupMode === 'modern') {\n data = _this.base.getGroupedDataModernMode(data, groupField);\n }\n var group = data[0][groupField];\n for (var i = 1; i < data.length; i++) {\n if (itemHeight * i > scrollTop) {\n break;\n }\n if (data[i] && data[i][groupField]) {\n group = data[i][groupField];\n }\n }\n if (group !== _this.state.group) {\n _this.setState({\n group: group\n });\n if (_this.props.onGroupScroll) {\n _this.props.onGroupScroll.call(undefined, { group: group });\n }\n }\n };\n _this.handleItemClick = function (index, event) {\n _this.base.handleItemClick(index, event);\n _this._valueDuringOnChange = undefined;\n };\n _this.handleBlur = function (event) {\n if (_this.state.focused && !_this._skipBlur) {\n var state = _this.base.initState();\n var _a = _this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b;\n var focusedIndex = _this.getFocusedIndex();\n var isCustomValue = focusedIndex === -1;\n var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);\n state.data.focused = false;\n state.events.push({ type: 'onBlur' });\n state.syntheticEvent = event;\n if (textField && isCurrentValueDisabled) {\n _this.clearValueOnBlur(event);\n }\n _this.applyValueOnRejectSuggestions(event.currentTarget.value, state);\n }\n };\n _this.onInputClick = function (event) {\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var mobileText = _this.props.adaptiveFilter !== undefined ? _this.props.adaptiveFilter : _this.state.text || null;\n if (!opened && _this.mobileMode) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n _this.base.togglePopup(state);\n _this.base.filterChanged(mobileText, state);\n _this.applyState(state);\n }\n };\n _this.onInputKeyDown = function (event) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, skipDisabledItems = _a.skipDisabledItems, textField = _a.textField, dataItemKey = _a.dataItemKey, groupField = _a.groupField;\n var value = _this.value;\n var selectedIndex = Math.max(0, data.findIndex(function (i) { return areSame(i, value, dataItemKey); }));\n var keyCode = event.keyCode;\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (!event.altKey && (keyCode === Keys.up || keyCode === Keys.down)) {\n event.preventDefault();\n if (groupField !== '' && textField) {\n if (!_this.props.skipDisabledItems && opened) {\n _this.onNavigate(state, keyCode);\n }\n else {\n var newIndex = 0;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n var tempnewIndex_1 = data.slice(selectedIndex + 1).find(function (i) { return !i.disabled && i[textField]; });\n newIndex = tempnewIndex_1 && data.findIndex(function (el) { return el[textField] === tempnewIndex_1[textField]; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataToSearch = void 0;\n if (selectedIndex === 0) {\n dataToSearch = data;\n newIndex = data.findIndex(function (i) { return !i.disabled && i[textField]; });\n }\n else {\n dataToSearch = data.slice(0, selectedIndex);\n var tempnewIndex_2 = dataToSearch.pop();\n while (tempnewIndex_2 && tempnewIndex_2.disabled) {\n tempnewIndex_2 = dataToSearch.pop();\n }\n newIndex = tempnewIndex_2 && data.findIndex(function (el) { return el[textField] === tempnewIndex_2[textField]; });\n }\n }\n if (newIndex !== undefined) {\n var skipItems = newIndex - selectedIndex;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else if (newIndex === undefined && data.findIndex(function (el) { return el[textField] === value[textField]; }) === data.length - 1) {\n _this.onNavigate(state, keyCode);\n }\n }\n }\n else if (!_this.props.skipDisabledItems && opened) {\n _this.onNavigate(state, keyCode);\n }\n else {\n var newIndex = null;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n newIndex = data.slice(selectedIndex + 1).find(function (i) { return !i.disabled; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataTest = data.slice(0, selectedIndex);\n newIndex = dataTest.pop();\n while (newIndex && newIndex.disabled) {\n newIndex = dataTest.pop();\n }\n }\n if (newIndex) {\n var skipItems = newIndex.id - selectedIndex - 1;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else {\n _this.onNavigate(state, keyCode);\n }\n }\n _this.applyState(state);\n }\n var togglePopup = function () {\n event.preventDefault();\n _this.base.togglePopup(state);\n _this.applyState(state);\n };\n var focusedIndex = _this.getFocusedIndex();\n var isCustomValue = focusedIndex === -1;\n var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);\n if (opened) {\n if (keyCode === Keys.pageUp) {\n _this.base.scrollPopupByPageSize(-1);\n }\n else if (keyCode === Keys.pageDown) {\n _this.base.scrollPopupByPageSize(1);\n }\n else if (event.altKey && keyCode === Keys.up) {\n togglePopup();\n }\n else if (keyCode === Keys.enter) {\n event.preventDefault();\n var currentValueText = textField && !isCustomValue && event.currentTarget.value ? data[focusedIndex][textField] : undefined;\n if (currentValueText) {\n if (!skipDisabledItems && textField && isCurrentValueDisabled) {\n _this.clearValueOnEnterOrEsc(event);\n }\n else if (!isCurrentValueDisabled) {\n _this.applyValueOnEnter(event.currentTarget.value, state);\n }\n }\n else {\n _this.applyValueOnEnter(event.currentTarget.value, state);\n }\n }\n else if (keyCode === Keys.esc) {\n if (!skipDisabledItems && textField && isCurrentValueDisabled) {\n _this.clearValueOnEnterOrEsc(event);\n }\n _this.applyValueOnRejectSuggestions(event.currentTarget.value, state);\n }\n }\n else if (!opened && keyCode === Keys.esc) {\n _this.clearValueOnEnterOrEsc(event);\n }\n else if (event.altKey && keyCode === Keys.down) {\n togglePopup();\n }\n };\n _this.inputOnChange = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var input = event.currentTarget;\n var value = input.value;\n if (_this.props.suggest) {\n var selectionAtEnd = input.selectionEnd === value.length;\n var prevText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n if (!isPresent(prevText)) {\n prevText = getItemValue(_this.value, _this.props.textField) || '';\n }\n var deletedSuggestion = prevText && prevText === value;\n var deleting = prevText && prevText.length > value.length;\n if (deletedSuggestion || deleting || !selectionAtEnd) {\n _this._suggested = '';\n }\n else {\n _this.suggestValue(value);\n }\n }\n if (_this.props.filter === undefined) {\n state.data.text = value;\n }\n if (_this.state.focusedItem !== undefined) {\n state.data.focusedItem = undefined;\n }\n if (!opened) {\n _this.base.togglePopup(state);\n }\n _this.base.filterChanged(value, state);\n _this.applyState(state);\n _this.setState({ group: undefined });\n };\n _this.clearButtonClick = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n _this.clearValue();\n };\n _this.clearValueOnEnterOrEsc = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n _this.clearValue();\n };\n _this.clearValueOnBlur = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n _this.clearValue();\n };\n _this.clearValueOnToggleBtnClick = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n _this.clearValue();\n };\n _this.setValidity = function () {\n if (_this._input && _this._input.setCustomValidity) {\n _this._input.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || VALIDATION_MESSAGE);\n }\n };\n validatePackage(packageMetadata);\n return _this;\n }\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"document\", {\n get: function () {\n if (!canUseDOM) {\n return;\n }\n // useful only for user actions\n return (this.element && this.element.ownerDocument) || document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"element\", {\n /** @hidden */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"mobileMode\", {\n /**\n * The mobile mode of the ComboBox.\n */\n get: function () {\n var isAdaptive = this.state.windowWidth && this.state.windowWidth <= MOBILE_MEDIUM_DEVISE && this.props.adaptive;\n return !!isAdaptive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"value\", {\n /**\n * The value of the ComboBox.\n */\n get: function () {\n if (this._valueDuringOnChange !== undefined) {\n return this._valueDuringOnChange;\n }\n else if (this.props.value !== undefined) {\n return this.props.value;\n }\n else if (this.state.value !== undefined) {\n return this.state.value;\n }\n else if (this.props.defaultValue !== undefined) {\n return this.props.defaultValue;\n }\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"index\", {\n /**\n * The index of the selected item.\n */\n get: function () {\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey;\n var value = this.value;\n // TO DO: deprecate it!\n return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the ComboBox.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the component is set.\n */\n get: function () {\n // remove the undefined check when this is fixed:\n // https://github.com/telerik/kendo-react-private/issues/252\n var customError = this.props.validationMessage !== undefined;\n var isValid = (!this.required\n || (this.value !== null && this.value !== '' && this.value !== undefined));\n var valid = this.props.valid !== undefined ? this.props.valid : isValid;\n return {\n customError: customError,\n valid: valid,\n valueMissing: this.value === null\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"validityStyles\", {\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : ComboBoxWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ComboBoxWithoutContext.prototype, \"required\", {\n /** @hidden */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : ComboBoxWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n /** @hidden */\n ComboBoxWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {\n var _a;\n var _b = this.props, dataItemKey = _b.dataItemKey, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c, _d = _b.data, data = _d === void 0 ? [] : _d, textField = _b.textField;\n var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;\n var opening = !prevOpened && opened;\n var selectedItem = this.value;\n this._valueOnDidUpdate = selectedItem;\n if (virtual && virtual.total !== prevTotal) {\n this.base.vs.calcScrollElementHeight();\n this.base.vs.reset();\n }\n else {\n var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;\n var selectedItemIndex = data.findIndex(function (i) { return areSame(i, selectedItem, dataItemKey); });\n // Needed to calculate the proper item index when in 'modern' grouping mode\n if (this.props.groupMode === 'modern' && textField && selectedItem) {\n selectedItemIndex = (_a = this.base.getGroupedDataModernMode(data, groupField)) === null || _a === void 0 ? void 0 : _a.map(function (el) { return el[textField]; }).indexOf(selectedItem[textField]);\n }\n var selectedItemChanged = !areSame(prevSelectedItem, selectedItem, dataItemKey);\n if (opening && virtual) {\n this.base.scrollToVirtualItem(virtual, selectedItemIndex);\n }\n else if (opening && !virtual) {\n this.onPopupOpened();\n // Resets the sticky header group value for scenarios with open/close of component's popup\n if (data && data.length !== 0) {\n this.base.resetGroupStickyHeader(data[0][groupField], this);\n }\n this.base.scrollToItem(selectedItemIndex);\n }\n else if (opened && prevOpened && selectedItem && selectedItemChanged) {\n this.base.scrollToItem(selectedItemIndex);\n }\n }\n if (opening && this._input) {\n this._input.focus();\n }\n this.setValidity();\n };\n /** @hidden */\n ComboBoxWithoutContext.prototype.componentDidMount = function () {\n var _a;\n this.observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this));\n this.base.didMount();\n this.setValidity();\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.observe(this.document.body);\n }\n };\n /** @hidden */\n ComboBoxWithoutContext.prototype.componentWillUnmount = function () {\n var _a;\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.disconnect();\n }\n };\n /** @hidden */\n ComboBoxWithoutContext.prototype.render = function () {\n var _a;\n var btnAriaLabelExpand = provideLocalizationService(this).toLanguageString(comboArrowBtnAriaLabelExpand, messages[comboArrowBtnAriaLabelExpand]);\n var btnAriaLabelCollapse = provideLocalizationService(this).toLanguageString(comboArrowBtnAriaLabelCollapse, messages[comboArrowBtnAriaLabelCollapse]);\n var _b = this.props, dir = _b.dir, disabled = _b.disabled, _c = _b.clearButton, clearButton = _c === void 0 ? ComboBoxWithoutContext.defaultProps.clearButton : _c, label = _b.label, textField = _b.textField, adaptive = _b.adaptive, className = _b.className, style = _b.style, loading = _b.loading, iconClassName = _b.iconClassName, virtual = _b.virtual, size = _b.size, rounded = _b.rounded, fillMode = _b.fillMode, _d = _b.opened, opened = _d === void 0 ? this.state.opened : _d, placeholder = _b.placeholder;\n var _e = this.state.windowWidth, windowWidth = _e === void 0 ? 0 : _e;\n var isValid = !this.validityStyles || this.validity.valid;\n var text = this.props.filter !== undefined ? this.props.filter : this.state.text;\n var selectedItemText = getItemValue(this.value, textField);\n var inputText = isPresent(text) ? text : selectedItemText;\n var renderClearButton = clearButton && (!!(inputText) || isPresent(this.value));\n var base = this.base;\n var vs = base.vs;\n var id = this.props.id || this._inputId;\n var renderAdaptive = windowWidth <= MOBILE_MEDIUM_DEVISE && adaptive;\n vs.enabled = virtual !== undefined;\n if (virtual !== undefined) {\n vs.skip = virtual.skip;\n vs.total = virtual.total;\n vs.pageSize = virtual.pageSize;\n }\n var combobox = (React.createElement(React.Fragment, null,\n React.createElement(\"span\", { className: classNames('k-combobox k-input', (_a = {},\n _a[\"k-input-\".concat(sizeMap[size] || size)] = size,\n _a[\"k-rounded-\".concat(roundedMap[rounded] || rounded)] = rounded,\n _a[\"k-input-\".concat(fillMode)] = fillMode,\n _a['k-invalid'] = !isValid,\n _a['k-loading'] = loading,\n _a['k-required'] = this.required,\n _a['k-disabled'] = disabled,\n _a), className), ref: this.componentRef, style: !label ? style : __assign(__assign({}, style), { width: undefined }), dir: dir },\n this.renderSearchBar(inputText || '', id, placeholder),\n renderClearButton && !loading && React.createElement(ClearButton, { onClick: this.clearButtonClick, key: \"clearbutton\" }),\n loading && React.createElement(IconWrap, { className: \"k-input-loading-icon\", name: 'loading', key: \"loading\" }),\n React.createElement(Button, { tabIndex: -1, type: \"button\", \"aria-label\": opened ? btnAriaLabelCollapse : btnAriaLabelExpand, icon: !iconClassName ? 'caret-alt-down' : undefined, svgIcon: !iconClassName ? caretAltDownIcon : this.props.svgIcon, iconClass: iconClassName, size: size, fillMode: fillMode, rounded: null, themeColor: 'base', className: \"k-input-button\", onClick: this.toggleBtnClick, onMouseDown: function (e) { return e.preventDefault(); } }),\n !renderAdaptive && this.renderListContainer()),\n renderAdaptive && this.renderAdaptiveListContainer()));\n return label\n ? (React.createElement(FloatingLabel, { label: label, editorId: id, editorValue: inputText, editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: combobox }))\n : combobox;\n };\n /** @hidden */\n ComboBoxWithoutContext.prototype.onNavigate = function (state, keyCode, skipItems) {\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;\n var text = this.props.filter ? this.props.filter : this.state.text;\n var focusedIndex = this.getFocusedIndex();\n var vs = this.base.vs;\n var value = this.value;\n this._suggested = '';\n if (focusedIndex !== -1 && !isPresent(value)) {\n this.handleItemSelect(focusedIndex, state);\n }\n else if (text === '') {\n this.handleItemSelect(0, state);\n }\n else {\n var currentIndex = virtual.skip + focusedIndex;\n var newIndex = this.base.navigation.navigate({\n keyCode: keyCode,\n current: currentIndex,\n max: (vs.enabled ? vs.total : data.length) - 1,\n min: 0,\n skipItems: skipItems ? skipItems : undefined\n });\n if (newIndex !== undefined) {\n this.handleItemSelect(newIndex, state);\n }\n }\n };\n ;\n ComboBoxWithoutContext.prototype.getCurrentValueDisabledStatus = function (textField, data, focusedIndex) {\n return textField && data && data[focusedIndex] && data[focusedIndex].disabled;\n };\n ComboBoxWithoutContext.prototype.applyValueOnEnter = function (value, state) {\n var _a;\n var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var currentValueText = getItemValue(this.value, textField);\n var valueIndex = currentValueText === value ?\n this.index : getItemIndexByText(data, value, textField);\n var itemSelected = valueIndex !== -1;\n var newSelected = undefined;\n this._suggested = '';\n if (itemSelected) { // typed text match item from list\n newSelected = data[valueIndex];\n }\n else {\n if (allowCustom) { // any custom text not in list\n newSelected = textField !== undefined ? (_a = {}, _a[textField] = value, _a) : value;\n }\n else {\n return this.selectFocusedItem(value, state);\n }\n }\n this.triggerOnChange(newSelected, state);\n if (opened) {\n this.base.togglePopup(state);\n }\n if (this.props.filter === undefined && this.state.text !== undefined) {\n state.data.text = undefined;\n }\n this.applyState(state);\n };\n ComboBoxWithoutContext.prototype.applyValueOnRejectSuggestions = function (text, state) {\n var _a;\n var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var valueItemText = getItemValue(this.value, textField);\n var isMobileDevice = this.state.windowWidth && this.state.windowWidth <= MOBILE_MEDIUM_DEVISE;\n this._suggested = '';\n if (text === valueItemText || (text === '' && !isPresent(valueItemText))) {\n if (opened && !isMobileDevice) {\n this.base.togglePopup(state);\n }\n return this.applyState(state);\n }\n var valueIndex = getItemIndexByText(data, text, textField, true);\n var itemSelected = valueIndex !== -1;\n var newSelected = null;\n if (itemSelected) {\n newSelected = data[valueIndex];\n }\n else if (allowCustom) {\n newSelected = text ? (textField ? (_a = {}, _a[textField] = text, _a) : text) : null;\n }\n this.triggerOnChange(newSelected, state);\n if (this.state.text !== undefined) {\n state.data.text = undefined;\n this.base.filterChanged('', state);\n }\n if (opened && !isMobileDevice) {\n this.base.togglePopup(state);\n }\n this.applyState(state);\n };\n ComboBoxWithoutContext.prototype.selectFocusedItem = function (text, state) {\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? itemIndexStartsWith : _d;\n var skip = virtual.skip;\n var focusedIndex = (text === '' && skip === 0) ? 0 :\n focusedItemIndex(data, text, textField);\n if (focusedIndex !== -1) {\n this.handleItemSelect(focusedIndex + skip, state);\n }\n else {\n this.triggerOnChange(null, state);\n if (this.state.text !== undefined) {\n state.data.text = undefined;\n }\n }\n if (opened) {\n this.base.togglePopup(state);\n }\n return this.applyState(state);\n };\n ComboBoxWithoutContext.prototype.renderAdaptiveListContainer = function () {\n var _a;\n var _this = this;\n var _b = this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;\n var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, _d = _c.data, data = _d === void 0 ? [] : _d, groupField = _c.groupField, groupMode = _c.groupMode, list = _c.list, virtual = _c.virtual, adaptiveTitle = _c.adaptiveTitle, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var group = this.state.group;\n if (group === undefined && groupField !== undefined) {\n group = getItemValue(data[0], groupField);\n }\n var actionSheetProps = {\n navigatable: false,\n navigatableElements: [],\n expand: opened,\n animation: true,\n onClose: function (event) { return _this.toggleBtnClick(event); },\n animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,\n className: windowWidth <= MOBILE_SMALL_DEVISE\n ? 'k-adaptive-actionsheet k-actionsheet-fullscreen'\n : 'k-adaptive-actionsheet k-actionsheet-bottom'\n };\n return (React.createElement(React.Fragment, null,\n React.createElement(ActionSheet, __assign({}, actionSheetProps),\n React.createElement(ActionSheetHeader, { className: 'k-text-center' },\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-hbox\" },\n React.createElement(\"div\", { className: \"k-actionsheet-title\" },\n React.createElement(\"div\", null, adaptiveTitle)),\n React.createElement(\"div\", { className: \"k-actionsheet-actions\" },\n React.createElement(Button, { tabIndex: 0, \"aria-label\": \"Cancel\", \"aria-disabled\": \"false\", type: \"button\", fillMode: \"flat\", onClick: this.toggleBtnClick, icon: 'x', svgIcon: xIcon }))),\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-actionsheet-filter\" }, this.renderMobileListFilter())),\n React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' },\n React.createElement(\"div\", { className: 'k-list-container' },\n React.createElement(\"div\", { className: classNames((_a = {},\n _a['k-list'] = !list,\n _a['k-list-lg'] = true,\n _a['k-virtual-list'] = virtual,\n _a['k-data-table'] = list,\n _a[\"k-table-\".concat(sizeMap[size] || size)] = list && size,\n _a)) },\n header && React.createElement(\"div\", { className: \"k-table-header\" }, header),\n !list && group && data.length !== 0 && React.createElement(GroupStickyHeader, { group: group, groupMode: groupMode, render: groupStickyHeaderItemRender }),\n this.renderList(),\n footer && React.createElement(\"div\", { className: \"k-list-footer\" }, footer)))))));\n };\n ComboBoxWithoutContext.prototype.renderListContainer = function () {\n var _a, _b;\n var base = this.base;\n var _c = this.props, dir = _c.dir, header = _c.header, footer = _c.footer, _d = _c.data, data = _d === void 0 ? [] : _d, groupField = _c.groupField, groupMode = _c.groupMode, size = _c.size, list = _c.list, virtual = _c.virtual, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var popupSettings = base.getPopupSettings();\n var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;\n var group = this.state.group;\n if (group === undefined && groupField !== undefined) {\n group = getItemValue(data[0], groupField);\n }\n return (React.createElement(ListContainer, { width: popupWidth, popupSettings: {\n animate: popupSettings.animate,\n anchor: this.element,\n show: opened,\n popupClass: classNames(popupSettings.popupClass, 'k-list-container', 'k-combobox-popup'),\n className: popupSettings.className,\n appendTo: popupSettings.appendTo\n }, dir: dir !== undefined ? dir : this.base.dirCalculated, itemsCount: [data.length] },\n React.createElement(\"div\", { className: classNames((_a = {},\n _a['k-list'] = !list,\n _a[\"k-list-\".concat(sizeMap[size] || size)] = !list && size,\n _a['k-virtual-list'] = virtual,\n _a['k-data-table'] = list,\n _a[\"k-table-\".concat(sizeMap[size] || size)] = list && size,\n _a)) },\n header && React.createElement(\"div\", { className: \"k-table-header\" }, header),\n !list && group && data.length !== 0 && React.createElement(GroupStickyHeader, { group: group, groupMode: groupMode, render: groupStickyHeaderItemRender }),\n this.renderList(),\n footer &&\n React.createElement(\"div\", { className: classNames((_b = {},\n _b['k-list-footer'] = !this.props.footerClassName,\n _b), this.props.footerClassName) }, footer))));\n };\n ComboBoxWithoutContext.prototype.renderList = function () {\n var _a;\n var _this = this;\n var base = this.base;\n var _b = this.props, textField = _b.textField, dataItemKey = _b.dataItemKey, listNoDataRender = _b.listNoDataRender, itemRender = _b.itemRender, groupHeaderItemRender = _b.groupHeaderItemRender, _c = _b.data, data = _c === void 0 ? [] : _c, _d = _b.virtual, virtual = _d === void 0 ? { skip: 0 } : _d;\n var popupSettings = base.getPopupSettings();\n var vs = base.vs;\n var skip = virtual.skip;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var translate = \"translateY(\".concat(vs.translate, \"px)\");\n var focusedIndex = opened ? this.getFocusedIndex() : undefined;\n var text = this.props.filter !== undefined ? this.props.filter : this.state.text;\n var selectedItemText = getItemValue(this.value, textField);\n var value = isPresent(text) && text !== selectedItemText ? null : this.value;\n var ListComponent = this.props.list || List;\n return (React.createElement(ListComponent, { id: base.listBoxId, virtual: Boolean(virtual), show: opened, data: data, focusedIndex: focusedIndex, value: value, textField: textField, valueField: dataItemKey, groupField: this.props.groupField, groupMode: this.props.groupMode, isMultiColumn: this.props.isMultiColumn, optionsGuid: base.guid, listRef: function (list) { vs.list = _this.base.list = list; _this.itemHeight = 0; }, wrapperStyle: (this.state.windowWidth && this.state.windowWidth > MOBILE_MEDIUM_DEVISE)\n ? { maxHeight: popupSettings.height }\n : {}, wrapperCssClass: classNames('k-list-content', (_a = {},\n _a['k-list-scroller'] = !virtual,\n _a)), listStyle: vs.enabled ? { transform: translate } : undefined, key: \"listkey\", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, groupHeaderItemRender: groupHeaderItemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll, wrapperRef: vs.scrollerRef, scroller: this.base.renderScrollElement() }));\n };\n ComboBoxWithoutContext.prototype.renderSearchBar = function (text, id, placeholder) {\n var _this = this;\n var _a = this.props, tabIndex = _a.tabIndex, disabled = _a.disabled, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var value = this.value;\n var selectedIndex = Math.max(0, data.findIndex(function (i) { return areSame(i, value, dataItemKey); }));\n if (this._suggested && !areSame(this._valueOnDidUpdate, value, dataItemKey)) {\n this._suggested = '';\n }\n return (React.createElement(SearchBar, { id: id, readOnly: (opened && this.mobileMode), placeholder: placeholder, tabIndex: tabIndex, title: this.props.title, accessKey: this.props.accessKey, value: text + this._suggested, suggestedText: this._suggested, ref: function (el) { return _this._input = el && el.input; }, onClick: this.onInputClick, onKeyDown: this.onInputKeyDown, onChange: this.inputOnChange, onFocus: this.base.handleFocus, onBlur: this.handleBlur, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: \"option-\".concat(this.base.guid, \"-\").concat(selectedIndex + virtual.skip), role: \"combobox\", ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, ariaRequired: this.required, render: this.props.valueRender }));\n };\n ComboBoxWithoutContext.prototype.clearValue = function () {\n var state = this.base.initState();\n this._suggested = '';\n this.base.filterChanged('', state);\n if (this.props.filter === undefined && this.state.text !== undefined) {\n state.data.text = undefined;\n }\n this.triggerOnChange(null, state);\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n var isAdaptive = this.mobileMode;\n if (opened && !isAdaptive) {\n this.base.togglePopup(state);\n }\n this.applyState(state);\n };\n ComboBoxWithoutContext.prototype.triggerOnChange = function (item, state) {\n var value = this.value;\n if ((!isPresent(value) && !isPresent(item)) || areSame(value, item, this.props.dataItemKey)) {\n return;\n }\n if (this.props.value === undefined) {\n state.data.value = item;\n }\n this._valueDuringOnChange = item;\n state.events.push({ type: 'onChange' });\n };\n ComboBoxWithoutContext.prototype.getFocusedIndex = function () {\n var value = this.value;\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? itemIndexStartsWith : _d, skipDisabledItems = _a.skipDisabledItems;\n var text = this.props.filter ? this.props.filter : this.state.text;\n if (isPresent(value) && text === undefined) {\n return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });\n }\n else if (text) {\n return focusedItemIndex(data, text, textField);\n }\n else if (skipDisabledItems && textField && !text && virtual.skip === 0) {\n return data.findIndex(function (i) { return !i.disabled && i[textField]; });\n }\n else {\n return virtual.skip === 0 ? 0 : -1;\n }\n };\n ComboBoxWithoutContext.prototype.suggestValue = function (value) {\n var _a = this.props, data = _a.data, textField = _a.textField;\n this._suggested = suggestValue(value, data, textField);\n };\n ComboBoxWithoutContext.prototype.applyState = function (state) {\n this.base.applyState(state);\n this._valueDuringOnChange = undefined;\n };\n ComboBoxWithoutContext.prototype.calculateMedia = function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n this.setState({ windowWidth: entry.target.clientWidth });\n }\n ;\n };\n ;\n ComboBoxWithoutContext.displayName = 'ComboBox';\n /** @hidden */\n ComboBoxWithoutContext.propTypes = __assign(__assign({}, DropDownBase.propTypes), { size: PropTypes.oneOf([null, 'small', 'medium', 'large']), rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']), fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']), dataItemKey: PropTypes.string, groupField: PropTypes.string, groupMode: PropTypes.oneOf([undefined, 'classic', 'modern']), isMultiColumn: PropTypes.bool, suggest: PropTypes.bool, placeholder: PropTypes.string, title: PropTypes.string, allowCustom: PropTypes.bool, clearButton: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: svgIconPropType, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, list: PropTypes.any, valueRender: PropTypes.func, skipDisabledItems: PropTypes.bool });\n /** @hidden */\n ComboBoxWithoutContext.defaultProps = __assign(__assign({}, DropDownBase.defaultProps), { size: 'medium', rounded: 'medium', fillMode: 'solid', allowCustom: false, clearButton: true, required: false, groupMode: 'classic', isMultiColumn: false, skipDisabledItems: true });\n return ComboBoxWithoutContext;\n}(React.Component));\nexport { ComboBoxWithoutContext };\n/**\n * Represents the PropsContext of the `ComboBox` component.\n * Used for global configuration of all `ComboBox` instances.\n *\n * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.\n */\nexport var ComboBoxPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).\n *\n * Accepts properties of type [ComboBoxProps]({% slug api_dropdowns_comboboxprops %}).\n * Obtaining the `ref` returns an object of type [ComboBoxHandle]({% slug api_dropdowns_comboboxhandle %}).\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * combobox = null;\n * render() {\n * return (\n *
\n * this.combobox = component}\n * />\n * \n *
\n * );\n * }\n * }\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var ComboBox = withPropsContext(ComboBoxPropsContext, ComboBoxWithoutContext);\nComboBox.displayName = 'KendoReactComboBox';\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { Chip } from '@progress/kendo-react-buttons';\nvar preventDefault = function (event) { return event.syntheticEvent.preventDefault(); };\nvar stopPropagation = function (event) { return event.syntheticEvent.stopPropagation(); };\n/**\n * @hidden\n */\nvar TagList = /** @class */ (function (_super) {\n __extends(TagList, _super);\n function TagList() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TagList.prototype.render = function () {\n var _a = this.props, data = _a.data, guid = _a.guid, focused = _a.focused, tagRender = _a.tagRender, TagComponent = _a.tag, onTagDelete = _a.onTagDelete, size = _a.size;\n return (React.createElement(React.Fragment, null,\n data.map(function (tagData, index) {\n var tag = TagComponent ? (React.createElement(TagComponent, { key: tagData.text + index, tagData: tagData, guid: guid, focusedTag: focused, onTagDelete: onTagDelete })) : (React.createElement(Chip, { id: \"tag-\".concat(guid, \"-\").concat(tagData.text.replace(/\\s+/g, '-')), \"aria-selected\": true, role: \"option\", \"aria-setsize\": data.length, key: tagData.text + index, text: tagData.text, removable: true, onRemove: function (e) { return onTagDelete.call(undefined, tagData.data, e.syntheticEvent); }, onMouseDown: preventDefault, onClick: stopPropagation, className: tagData === focused ? 'k-focus' : undefined, size: size }));\n return tagRender ? tagRender(tagData, tag) : tag;\n }),\n this.props.children));\n };\n return TagList;\n}(React.Component));\nexport default TagList;\n","/**\n * @hidden\n */\nexport var ActiveDescendant;\n(function (ActiveDescendant) {\n ActiveDescendant[ActiveDescendant[\"PopupList\"] = 0] = \"PopupList\";\n ActiveDescendant[ActiveDescendant[\"TagsList\"] = 1] = \"TagsList\";\n})(ActiveDescendant || (ActiveDescendant = {}));\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { ActionSheet, ActionSheetFooter, ActionSheetHeader } from '@progress/kendo-react-layout';\nimport { xIcon } from '@progress/kendo-svg-icons';\nimport { Button } from '@progress/kendo-react-buttons';\n/** @hidden */\nvar MOBILE_SMALL_DEVISE = 500;\n/** @hidden */\nexport var AdaptiveMode = function (props) {\n var footer = props.footer, children = props.children, _a = props.windowWidth, windowWidth = _a === void 0 ? 0 : _a, navigatable = props.navigatable, navigatableElements = props.navigatableElements, expand = props.expand, animation = props.animation, onClose = props.onClose, adaptiveTitle = props.adaptiveTitle, mobileFilter = props.mobileFilter;\n var defaultProps = {\n navigatable: navigatable || false,\n navigatableElements: navigatableElements || [],\n expand: expand,\n animation: animation === false ? false : true,\n onClose: onClose,\n animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,\n className: windowWidth <= MOBILE_SMALL_DEVISE\n ? 'k-adaptive-actionsheet k-actionsheet-fullscreen'\n : 'k-adaptive-actionsheet k-actionsheet-bottom'\n };\n return (React.createElement(ActionSheet, __assign({}, defaultProps),\n React.createElement(ActionSheetHeader, { className: 'k-text-center' },\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-hbox\" },\n React.createElement(\"div\", { className: \"k-actionsheet-title\" },\n React.createElement(\"div\", null, adaptiveTitle)),\n React.createElement(\"div\", { className: \"k-actionsheet-actions\" },\n React.createElement(Button, { tabIndex: 0, \"aria-label\": \"Cancel\", \"aria-disabled\": \"false\", type: \"button\", fillMode: \"flat\", icon: 'x', svgIcon: xIcon, onClick: onClose }))),\n mobileFilter &&\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-actionsheet-filter\" }, mobileFilter)),\n children,\n footer && React.createElement(ActionSheetFooter, { className: 'k-actions k-actions-stretched' },\n React.createElement(Button, { size: \"large\", tabIndex: 0, \"aria-label\": footer.cancelText, \"aria-disabled\": \"false\", type: \"button\", onClick: footer.onCancel }, footer.cancelText),\n React.createElement(Button, { tabIndex: 0, themeColor: \"primary\", size: \"large\", \"aria-label\": footer.applyText, \"aria-disabled\": \"false\", type: \"button\", onClick: footer.onApply }, footer.applyText))));\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, Keys, guid, createPropsContext, kendoThemeMaps, withPropsContext, IconWrap, canUseDOM } from '@progress/kendo-react-common';\nimport { plusIcon } from '@progress/kendo-svg-icons';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport ListContainer from '../common/ListContainer';\nimport List from '../common/List';\nimport GroupStickyHeader from '../common/GroupStickyHeader';\nimport TagList from './TagList';\nimport SearchBar from '../common/SearchBar';\nimport DropDownBase from '../common/DropDownBase';\nimport { ActiveDescendant } from './../common/settings';\nimport { itemIndexStartsWith, getItemValue, areSame, removeDataItems, isPresent, preventDefaultNonInputs, matchTags } from '../common/utils';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport ClearButton from '../common/ClearButton';\nimport { AdaptiveMode } from '../common/AdaptiveMode';\nimport { ActionSheetContent } from '@progress/kendo-react-layout';\nimport { MOBILE_MEDIUM_DEVISE } from '../common/constants';\nimport { provideLocalizationService } from '@progress/kendo-react-intl';\nimport { adaptiveModeFooterApply, adaptiveModeFooterCancel, messages } from '../messages';\nimport ListFilter from '../common/ListFilter';\nvar sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;\nvar VALIDATION_MESSAGE = 'Please enter a valid value!';\nvar preventDefault = function (event) { return event.preventDefault(); };\nvar isCustom = function (type) { return type === FocusedItemType.CustomItem; };\nvar FocusedItemType;\n(function (FocusedItemType) {\n FocusedItemType[FocusedItemType[\"None\"] = 0] = \"None\";\n FocusedItemType[FocusedItemType[\"ListItem\"] = 1] = \"ListItem\";\n FocusedItemType[FocusedItemType[\"CustomItem\"] = 2] = \"CustomItem\";\n})(FocusedItemType || (FocusedItemType = {}));\n/** @hidden */\nvar MultiSelectWithoutContext = /** @class */ (function (_super) {\n __extends(MultiSelectWithoutContext, _super);\n function MultiSelectWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n /** @hidden */\n _this.state = {\n activedescendant: ActiveDescendant.PopupList,\n currentValue: []\n };\n _this._element = null;\n _this._valueItemsDuringOnChange = null;\n _this._inputId = guid();\n _this.base = new DropDownBase(_this);\n _this._tags = [];\n _this._input = null;\n _this._adaptiveInput = null;\n _this._skipFocusEvent = false;\n _this.itemHeight = 0;\n _this.scrollToFocused = false;\n _this.localization = null;\n /** @hidden */\n _this.focus = function () {\n if (_this._input) {\n _this._input.focus();\n }\n };\n /** @hidden */\n _this.handleItemSelect = function (index, state) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual;\n var skip = virtual ? virtual.skip : 0;\n var dataItem = data[index - skip];\n var indexInValue = _this.value.findIndex(function (i) { return areSame(i, dataItem, dataItemKey); });\n var newItems = [];\n if (indexInValue !== -1) { // item is already selected\n newItems = _this.value;\n newItems.splice(indexInValue, 1);\n }\n else {\n newItems = __spreadArray(__spreadArray([], _this.value, true), [dataItem], false);\n }\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n if (text && !_this.mobileMode) {\n if (_this.state.text) {\n state.data.text = '';\n }\n _this.base.filterChanged('', state);\n }\n if (_this._adaptiveInput) {\n _this._adaptiveInput.blur();\n }\n ;\n if (_this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n _this.triggerOnChange(newItems, state);\n _this.base.triggerPageChangeCornerItems(dataItem, state);\n };\n /** @hidden */\n _this.onTagDelete = function (itemsToRemove, event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (_this.opened) {\n _this.base.togglePopup(state);\n }\n if (!_this.state.focused && !_this.mobileMode) {\n state.data.focused = true;\n _this.focus();\n }\n var selected = _this.value;\n removeDataItems(selected, itemsToRemove, _this.props.dataItemKey);\n _this.triggerOnChange(selected, state);\n _this.applyState(state);\n };\n /** @hidden */\n _this.itemFocus = function (index, state) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, allowCustom = _a.allowCustom, virtual = _a.virtual;\n var skip = virtual ? virtual.skip : 0;\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n var focusedIndex = _this.getFocusedState().focusedIndex;\n var customItem = allowCustom && text;\n var nextFocusedItem = data[index - skip];\n if (nextFocusedItem && focusedIndex !== index) {\n if (_this.state.focusedIndex !== index) {\n state.data.focusedIndex = index;\n state.data.activedescendant = ActiveDescendant.PopupList;\n }\n }\n else if (customItem && index === -1) {\n if (_this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n }\n _this.base.triggerPageChangeCornerItems(nextFocusedItem, state);\n };\n _this.componentRef = function (element) {\n _this._element = element;\n _this.base.wrapper = element;\n };\n _this.searchbarRef = function (searchbar) {\n var input = _this._input = searchbar && searchbar.input;\n if (input && _this.state.focused) {\n window.setTimeout(function () { return input.focus(); }, 0);\n }\n };\n _this.onChangeHandler = function (event) {\n var state = _this.base.initState();\n var value = event.target.value;\n state.syntheticEvent = event;\n if (_this.props.filter === undefined) {\n state.data.text = value;\n }\n state.data.focusedIndex = undefined;\n if (!_this.opened) {\n _this.base.togglePopup(state);\n _this.setState({ currentValue: _this.value });\n }\n _this.base.filterChanged(value, state);\n _this.applyState(state);\n _this.setState({ group: undefined });\n };\n _this.clearButtonClick = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n if (_this.value.length > 0) {\n _this.triggerOnChange([], state);\n }\n if (_this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n if (_this.opened) {\n _this.base.togglePopup(state);\n }\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n if (isPresent(text) && text !== '') {\n _this.base.filterChanged('', state);\n }\n if (_this.state.text) {\n state.data.text = '';\n }\n _this.applyState(state);\n };\n _this.onInputKeyDown = function (event) {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, groupField = _a.groupField;\n var keyCode = event.keyCode;\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;\n var _c = _this.getFocusedState(), focusedItem = _c.focusedItem, focusedIndex = _c.focusedIndex;\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (!text && _this.value.length > 0 &&\n (keyCode === Keys.left || keyCode === Keys.right ||\n keyCode === Keys.home || keyCode === Keys.end ||\n keyCode === Keys.delete || keyCode === Keys.backspace)) {\n return _this.onTagsNavigate(event, state);\n }\n var togglePopup = function () {\n event.preventDefault();\n _this.base.togglePopup(state);\n _this.applyState(state);\n };\n if (_this.opened) {\n if (event.altKey && keyCode === Keys.up) {\n togglePopup();\n }\n else if (keyCode === Keys.up || keyCode === Keys.down) {\n if (groupField !== '' && textField) {\n if (!_this.props.skipDisabledItems && opened) {\n _this.onNavigate(state, keyCode);\n }\n else {\n var newIndex = 0;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n var tempnewIndex_1 = data.slice(focusedIndex + 1).find(function (i) { return !i.disabled && i[textField]; });\n newIndex = tempnewIndex_1 && data.findIndex(function (el) { return el[textField] === tempnewIndex_1[textField]; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataToSearch = void 0;\n if (focusedIndex === -1) {\n dataToSearch = data;\n newIndex = data.findIndex(function (i) { return !i.disabled && i[textField]; });\n }\n else {\n dataToSearch = data.slice(0, focusedIndex);\n var tempnewIndex_2 = dataToSearch.pop();\n while (tempnewIndex_2 && tempnewIndex_2.disabled) {\n tempnewIndex_2 = dataToSearch.pop();\n }\n newIndex = tempnewIndex_2 && data.findIndex(function (el) { return el[textField] === tempnewIndex_2[textField]; });\n }\n }\n if (newIndex) {\n var skipItems = newIndex - focusedIndex;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else if (newIndex !== undefined) {\n _this.onNavigate(state, keyCode);\n }\n }\n }\n else if (!_this.props.skipDisabledItems && opened) {\n _this.onNavigate(state, keyCode);\n }\n else {\n var newIndex = null;\n if (keyCode === Keys.down || keyCode === Keys.right) {\n newIndex = data.slice(focusedIndex + 1).find(function (i) { return !i.disabled; });\n }\n else if (keyCode === Keys.up || keyCode === Keys.left) {\n var dataTest = data.slice(0, focusedIndex);\n newIndex = dataTest.pop();\n while (newIndex && newIndex.disabled) {\n newIndex = dataTest.pop();\n }\n }\n if (newIndex) {\n var skipItems = newIndex.id - focusedIndex - 1;\n _this.onNavigate(state, keyCode, skipItems);\n }\n else {\n _this.onNavigate(state, keyCode);\n }\n }\n _this.applyState(state);\n event.preventDefault();\n }\n else if (keyCode === Keys.enter) {\n event.preventDefault();\n if (_this.props.allowCustom && text && focusedItem === null) {\n _this.customItemSelect(event);\n }\n else if (focusedItem && focusedItem.disabled) {\n togglePopup();\n }\n else {\n _this.selectFocusedItem(event);\n }\n }\n else if (keyCode === Keys.esc) {\n togglePopup();\n }\n }\n else if (event.altKey && keyCode === Keys.down) {\n togglePopup();\n }\n };\n _this.listContainerContent = function () {\n var _a, _b;\n var _c = _this.props, header = _c.header, footer = _c.footer, allowCustom = _c.allowCustom, size = _c.size, _d = _c.data, data = _d === void 0 ? [] : _d, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender, groupField = _c.groupField, list = _c.list;\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n var focusedType = _this.getFocusedState().focusedType;\n var customItem = allowCustom && text && (React.createElement(\"div\", { className: classNames('k-list', (_a = {},\n _a[\"k-list-\".concat(sizeMap[size] || size)] = size,\n _a)), key: \"customitem\", onClick: _this.customItemSelect, onMouseDown: preventDefault },\n React.createElement(\"div\", { className: classNames('k-list-item k-custom-item', { 'k-focus': isCustom(focusedType) }), style: { fontStyle: 'italic' } },\n text,\n React.createElement(IconWrap, { name: 'plus', icon: plusIcon, style: { position: 'absolute', right: '0.5em' } }))));\n var group = _this.state.group;\n if (group === undefined && groupField !== undefined) {\n group = getItemValue(data[0], groupField);\n }\n return (React.createElement(React.Fragment, null,\n header && React.createElement(\"div\", { className: \"k-list-header\" }, header),\n customItem,\n React.createElement(\"div\", { className: classNames('k-list', (_b = {},\n _b[\"k-list-\".concat(_this.mobileMode ? 'lg' : sizeMap[size] || size)] = size,\n _b['k-virtual-list'] = _this.base.vs.enabled,\n _b)) },\n !list && group && data.length !== 0 && React.createElement(GroupStickyHeader, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),\n _this.renderList()),\n footer && React.createElement(\"div\", { className: \"k-list-footer\" }, footer)));\n };\n _this.renderListContainer = function () {\n var base = _this.base;\n var _a = _this.props, dir = _a.dir, _b = _a.data, data = _b === void 0 ? [] : _b;\n var popupSettings = _this.base.getPopupSettings();\n var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;\n var listContainerProps = {\n dir: dir !== undefined ? dir : base.dirCalculated,\n width: popupWidth,\n popupSettings: {\n popupClass: classNames(popupSettings.popupClass, 'k-list-container', 'k-multiselect-popup'),\n className: popupSettings.className,\n animate: popupSettings.animate,\n anchor: _this.element,\n show: _this.opened,\n onOpen: _this.onPopupOpened,\n onClose: _this.onPopupClosed,\n appendTo: popupSettings.appendTo\n },\n itemsCount: [data.length, _this.value.length]\n };\n return (React.createElement(ListContainer, __assign({}, listContainerProps), _this.listContainerContent()));\n };\n _this.renderAdaptiveListContainer = function () {\n var _a = _this.props, adaptiveTitle = _a.adaptiveTitle, filterable = _a.filterable, filter = _a.filter;\n var _b = _this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;\n var mobileText = filter !== undefined ? filter : _this.state.text;\n _this.localization = provideLocalizationService(_this);\n var mobileFilter = filterable ? (React.createElement(ListFilter, { value: mobileText, ref: function (adaptiveFilter) { return _this._adaptiveInput = adaptiveFilter && adaptiveFilter.element; }, onChange: _this.onChangeHandler, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode })) : null;\n var actionSheetProps = {\n adaptiveTitle: adaptiveTitle,\n expand: _this.opened,\n onClose: function (event) { return _this.onCancel(event); },\n windowWidth: windowWidth,\n mobileFilter: mobileFilter,\n footer: {\n cancelText: _this.localization.toLanguageString(adaptiveModeFooterCancel, messages[adaptiveModeFooterCancel]),\n onCancel: _this.onCancel,\n applyText: _this.localization.toLanguageString(adaptiveModeFooterApply, messages[adaptiveModeFooterApply]),\n onApply: _this.closePopup\n }\n };\n return (React.createElement(AdaptiveMode, __assign({}, actionSheetProps),\n React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' },\n React.createElement(\"div\", { className: 'k-list-container' }, _this.listContainerContent()))));\n };\n _this.closePopup = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n if (_this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n if (_this.opened) {\n _this.base.togglePopup(state);\n }\n state.events.push({ type: 'onClose' });\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n if (isPresent(text) && text !== '') {\n _this.base.filterChanged('', state);\n }\n if (_this.state.text) {\n state.data.text = '';\n }\n _this.applyState(state);\n };\n _this.onCancel = function (event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n event.stopPropagation();\n if (_this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n if (_this.opened) {\n _this.base.togglePopup(state);\n }\n state.events.push({ type: 'onCancel' });\n var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n if (isPresent(text) && text !== '') {\n _this.base.filterChanged('', state);\n }\n if (_this.state.text) {\n state.data.text = '';\n }\n _this.applyState(state);\n };\n _this.renderList = function () {\n var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender, groupHeaderItemRender = _a.groupHeaderItemRender, dataItemKey = _a.dataItemKey, virtual = _a.virtual;\n var vs = _this.base.vs;\n var skip = virtual ? virtual.skip : 0;\n var focusedIndex = _this.getFocusedState().focusedIndex;\n var popupSettings = _this.base.getPopupSettings();\n var translate = \"translateY(\".concat(vs.translate, \"px)\");\n return (React.createElement(List, { id: _this.base.listBoxId, show: _this.opened, data: data.slice(), focusedIndex: focusedIndex - skip, value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, groupField: _this.props.groupField, groupMode: 'modern', listRef: function (list) { vs.list = _this.base.list = list; }, wrapperStyle: _this.mobileMode ? {} : { maxHeight: popupSettings.height }, wrapperCssClass: \"k-list-content\", listStyle: vs.enabled ? { transform: translate } : undefined, key: \"listKey\", skip: skip, onClick: _this.handleItemClick, itemRender: itemRender, groupHeaderItemRender: groupHeaderItemRender, noDataRender: listNoDataRender, onMouseDown: preventDefault, onBlur: _this.handleBlur, onScroll: _this.onScroll, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));\n };\n _this.onScroll = function (event) {\n var _a = _this.base, vs = _a.vs, list = _a.list;\n vs.scrollHandler(event);\n var groupField = _this.props.groupField;\n var _b = _this.props.data, data = _b === void 0 ? [] : _b;\n if (!groupField || !data.length) {\n return;\n }\n if (groupField) {\n var itemHeight = _this.itemHeight =\n _this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));\n var target = event.target;\n var scrollTop = target.scrollTop - (vs.skip * itemHeight);\n data = _this.base.getGroupedDataModernMode(data, groupField);\n var group = data[0][groupField];\n for (var i = 1; i < data.length; i++) {\n if (itemHeight * i > scrollTop) {\n break;\n }\n if (data[i] && data[i][groupField]) {\n group = data[i][groupField];\n }\n }\n if (group !== _this.state.group) {\n _this.setState({\n group: group\n });\n }\n }\n };\n _this.customItemSelect = function (event) {\n var _a;\n var itemText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;\n var textField = _this.props.textField;\n if (!itemText) {\n return;\n }\n var state = _this.base.initState();\n state.syntheticEvent = event;\n var item = textField ? (_a = {}, _a[textField] = itemText, _a) : itemText;\n if (_this.state.text !== undefined) {\n state.data.text = '';\n }\n state.data.focusedIndex = undefined;\n _this.base.filterChanged('', state);\n var newItems = __spreadArray(__spreadArray([], _this.value, true), [item], false);\n _this.triggerOnChange(newItems, state);\n _this.base.togglePopup(state);\n _this.applyState(state);\n };\n _this.handleWrapperClick = function (event) {\n var input = _this._input;\n if (!_this.opened && input) {\n _this.focusElement(input);\n }\n var state = _this.base.initState();\n state.syntheticEvent = event;\n if (!_this.state.focused && !_this.mobileMode) {\n state.events.push({ type: 'onFocus' });\n state.data.focused = true;\n }\n if (_this.mobileMode) {\n _this.setState({ currentValue: _this.tagsToRender });\n if (_this.mobileMode) {\n window.setTimeout(function () { return _this._adaptiveInput && _this._adaptiveInput.focus(); }, 300);\n }\n }\n _this.base.togglePopup(state);\n _this.applyState(state);\n };\n _this.handleItemClick = function (index, event) {\n var state = _this.base.initState();\n state.syntheticEvent = event;\n _this.handleItemSelect(index, state);\n if (_this.props.autoClose && !_this.mobileMode) {\n _this.base.togglePopup(state);\n }\n event.stopPropagation();\n _this.applyState(state);\n };\n _this.handleBlur = function (event) {\n if (!_this.state.focused || _this._skipFocusEvent) {\n return;\n }\n var state = _this.base.initState();\n var _a = _this.props, allowCustom = _a.allowCustom, filterable = _a.filterable;\n state.syntheticEvent = event;\n state.data.focused = false;\n state.events.push({ type: 'onBlur' });\n if (_this.opened && !_this.mobileMode) {\n if (_this.state.opened) {\n state.data.opened = false;\n }\n state.events.push({ type: 'onClose' });\n }\n if (!allowCustom && !filterable && _this.state.text) {\n state.data.text = '';\n }\n _this.applyState(state);\n };\n _this.handleFocus = function (event) {\n if (_this._skipFocusEvent) {\n return;\n }\n _this.base.handleFocus(event);\n };\n _this.onPopupOpened = function () {\n if (_this._input && _this.state.focused && !_this.mobileMode) {\n _this.focusElement(_this._input);\n }\n };\n _this.onPopupClosed = function () {\n if (_this.state.focused) {\n window.setTimeout(function () { if (_this.state.focused) {\n _this.focusElement(_this._input);\n } }, 0);\n }\n };\n _this.setValidity = function () {\n if (_this._input && _this._input.setCustomValidity) {\n _this._input.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || VALIDATION_MESSAGE);\n }\n };\n validatePackage(packageMetadata);\n return _this;\n }\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"document\", {\n get: function () {\n if (!canUseDOM) {\n return;\n }\n // useful only for user actions\n return (this.element && this.element.ownerDocument) || document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"element\", {\n /** @hidden */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"opened\", {\n /** @hidden */\n get: function () {\n var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;\n return !!opened;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"tagsToRender\", {\n /** @hidden */\n get: function () {\n var _a = this.props, tags = _a.tags, textField = _a.textField;\n var tagsToRender = [];\n if (tags === undefined) {\n this.value.forEach(function (item) {\n tagsToRender.push({ text: getItemValue(item, textField), data: [item] });\n });\n }\n else {\n tagsToRender.push.apply(tagsToRender, tags);\n }\n return tagsToRender;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"mobileMode\", {\n /**\n * The mobile mode of the ComboBox.\n */\n get: function () {\n var isAdaptive = this.state.windowWidth && this.state.windowWidth <= MOBILE_MEDIUM_DEVISE && this.props.adaptive;\n return !!isAdaptive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"value\", {\n /**\n * Represents the value of the MultiSelect.\n */\n get: function () {\n var result = [];\n if (this._valueItemsDuringOnChange) {\n result.push.apply(result, this._valueItemsDuringOnChange);\n }\n else if (this.props.value) {\n result.push.apply(result, this.props.value);\n }\n else if (this.state.value) {\n result.push.apply(result, this.state.value);\n }\n else if (this.props.defaultValue) {\n result.push.apply(result, this.props.defaultValue);\n }\n return result;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the MultiSelect.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the MultiSelect is set.\n */\n get: function () {\n var customError = this.props.validationMessage !== undefined;\n var isValid = (!this.required\n || (this.value !== null && this.value.length > 0 && this.value !== undefined));\n var valid = this.props.valid !== undefined ? this.props.valid : isValid;\n return {\n customError: customError,\n valid: valid,\n valueMissing: this.value === null\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"required\", {\n /** @hidden */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : MultiSelectWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiSelectWithoutContext.prototype, \"validityStyles\", {\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : MultiSelectWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n /** @hidden */\n MultiSelectWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {\n var _a;\n var _b = this.props, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c, _d = _b.data, data = _d === void 0 ? [] : _d;\n var skip = virtual ? virtual.skip : 0;\n var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;\n var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;\n var opening = !prevOpened && this.opened;\n var closing = prevOpened && !this.opened;\n var popupSettings = this.base.getPopupSettings();\n if (!popupSettings.animate && closing) {\n this.onPopupClosed();\n }\n if (virtual && virtual.total !== prevTotal) {\n this.base.vs.calcScrollElementHeight();\n this.base.vs.reset();\n }\n else {\n var _e = this.getFocusedState(), focusedItem = _e.focusedItem, focusedIndex = _e.focusedIndex;\n if (groupField !== '') {\n focusedIndex = (_a = this.base.getGroupedDataModernMode(data, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(focusedItem);\n }\n if (opening && virtual) {\n this.base.scrollToVirtualItem(virtual, focusedIndex - skip);\n }\n else if (opening && !virtual) {\n // Resets the sticky header group value for scenarios with open/close of component's popup\n if (data && data.length !== 0) {\n this.base.resetGroupStickyHeader(data[0][groupField], this);\n }\n this.base.scrollToItem(focusedIndex);\n }\n else if (this.opened && prevOpened && focusedItem && this.scrollToFocused) {\n this.base.scrollToItem(focusedIndex - skip);\n }\n }\n this.scrollToFocused = false;\n this.setValidity();\n };\n /** @hidden */\n MultiSelectWithoutContext.prototype.componentDidMount = function () {\n var _a;\n this.observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this));\n this.base.didMount();\n this.setValidity();\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.observe(this.document.body);\n }\n };\n /** @hidden */\n MultiSelectWithoutContext.prototype.componentWillUnmount = function () {\n var _a;\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.disconnect();\n }\n };\n /** @hidden */\n MultiSelectWithoutContext.prototype.onNavigate = function (state, keyCode, skipItems) {\n var _a = this.props, allowCustom = _a.allowCustom, _b = _a.data, data = _b === void 0 ? [] : _b;\n var text = this.props.filter !== undefined ? this.props.filter : this.state.text;\n var _c = this.getFocusedState(), focusedType = _c.focusedType, focusedIndex = _c.focusedIndex;\n var customItem = allowCustom && text;\n var customItemFocused = isCustom(focusedType);\n var base = this.base;\n var vs = base.vs;\n if (this.opened && keyCode === Keys.up && customItemFocused) {\n if (this.state.focusedIndex !== undefined) {\n state.data.focusedIndex = undefined;\n }\n }\n else {\n var newFocused = base.navigation.navigate({\n keyCode: keyCode,\n current: focusedIndex,\n max: (vs.enabled ? vs.total : data.length) - 1,\n min: customItem ? -1 : 0,\n skipItems: skipItems ? skipItems : undefined\n });\n if (newFocused !== undefined) {\n this.itemFocus(newFocused, state);\n this.scrollToFocused = true;\n }\n }\n this.applyState(state);\n };\n /** @hidden */\n MultiSelectWithoutContext.prototype.render = function () {\n var _a, _b;\n var _c = this.props, style = _c.style, className = _c.className, label = _c.label, dir = _c.dir, disabled = _c.disabled, textField = _c.textField, dataItemKey = _c.dataItemKey, virtual = _c.virtual, size = _c.size, rounded = _c.rounded, fillMode = _c.fillMode, loading = _c.loading, filter = _c.filter;\n var _d = this.state, text = _d.text, focused = _d.focused, focusedTag = _d.focusedTag, currentValue = _d.currentValue;\n var vs = this.base.vs;\n var id = this.props.id || this._inputId;\n vs.enabled = virtual !== undefined;\n if (virtual !== undefined) {\n vs.skip = virtual.skip;\n vs.total = virtual.total;\n vs.pageSize = virtual.pageSize;\n }\n var currentTagsToRender = (this.mobileMode && this.opened) ? currentValue : this.tagsToRender;\n this.setItems(this.tagsToRender, this._tags);\n var isValid = !this.validityStyles || this.validity.valid;\n var clearButton = Boolean(filter !== undefined ? filter : text)\n || (currentTagsToRender && currentTagsToRender.length > 0);\n var component = (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { ref: this.componentRef, className: classNames('k-multiselect k-input', className, (_a = {},\n _a[\"k-input-\".concat(sizeMap[size] || size)] = size,\n _a[\"k-rounded-\".concat(roundedMap[rounded] || rounded)] = rounded,\n _a[\"k-input-\".concat(fillMode)] = fillMode,\n _a['k-focus'] = focused && !disabled,\n _a['k-invalid'] = !isValid,\n _a['k-disabled'] = disabled,\n _a['k-loading'] = loading,\n _a['k-required'] = this.required,\n _a)), style: !label\n ? style\n : __assign(__assign({}, style), { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: preventDefaultNonInputs },\n React.createElement(\"div\", { className: classNames('k-input-values') },\n React.createElement(\"div\", { className: classNames('k-chip-list', (_b = {}, _b[\"k-chip-list-\".concat(sizeMap[size] || size)] = size, _b)), role: \"listbox\", id: 'tagslist-' + this.base.guid }, currentTagsToRender && currentTagsToRender.length > 0 && React.createElement(TagList, { tagRender: this.props.tagRender, onTagDelete: this.onTagDelete, data: currentTagsToRender, guid: this.base.guid, focused: focusedTag ? currentTagsToRender.find(function (t) { return matchTags(t, focusedTag, dataItemKey); }) : undefined, size: size })),\n this.renderSearchBar(id)),\n loading && React.createElement(IconWrap, { className: \"k-input-loading-icon\", name: 'loading' }),\n clearButton && React.createElement(ClearButton, { onClick: this.clearButtonClick }),\n !this.mobileMode && this.renderListContainer()),\n this.mobileMode && this.renderAdaptiveListContainer()));\n return label ? (React.createElement(FloatingLabel, { label: label, editorId: id, editorValue: text || getItemValue(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;\n };\n MultiSelectWithoutContext.prototype.renderSearchBar = function (id) {\n var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag, currentValue = _a.currentValue;\n var _b = this.props, disabled = _b.disabled, placeholder = _b.placeholder, ariaDescribedBy = _b.ariaDescribedBy;\n var text = !this.mobileMode && (this.props.filter !== undefined ? this.props.filter : this.state.text) || '';\n var focusedIndex = this.getFocusedState().focusedIndex;\n var placeholderToShow = this.value.length === 0 && !text ? placeholder : undefined;\n var adaptivePlaceholder = (currentValue && currentValue.length > 0) ? undefined : placeholder;\n var ariaActivedescendant = activedescendant === ActiveDescendant.TagsList && focusedTag !== undefined ?\n \"tag-\".concat(this.base.guid, \"-\").concat(focusedTag.text.replace(/\\s+/g, '-')) :\n \"option-\".concat(this.base.guid, \"-\").concat(focusedIndex);\n return (React.createElement(SearchBar, { id: id, size: Math.max((placeholderToShow || '').length, text.length, 1), tabIndex: this.props.tabIndex, accessKey: this.props.accessKey, placeholder: this.mobileMode && this.opened ? adaptivePlaceholder : placeholderToShow, value: text, onChange: this.onChangeHandler, onKeyDown: this.onInputKeyDown, ref: this.searchbarRef, disabled: disabled, expanded: this.opened, owns: this.base.listBoxId, role: 'combobox', activedescendant: ariaActivedescendant, ariaDescribedBy: \"tagslist-\".concat(this.base.guid).concat(ariaDescribedBy ? (' ' + ariaDescribedBy) : ''), ariaLabelledBy: this.props.ariaLabelledBy, ariaRequired: this.required }));\n };\n MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {\n var keyCode = event.keyCode;\n var focusedTag = this.state.focusedTag;\n var tags = this._tags;\n var itemsKey = this.props.dataItemKey;\n var focusedIndex = focusedTag ?\n tags.findIndex(function (t) { return matchTags(t, focusedTag, itemsKey); }) : -1;\n var newFocusedTag = undefined;\n var hasFocused = focusedIndex !== -1;\n if (keyCode === Keys.left) {\n if (hasFocused) {\n focusedIndex = Math.max(0, focusedIndex - 1);\n }\n else {\n focusedIndex = tags.length - 1;\n }\n newFocusedTag = tags[focusedIndex];\n }\n else if (keyCode === Keys.right) {\n if (focusedIndex === tags.length - 1) {\n newFocusedTag = undefined;\n }\n else if (hasFocused) {\n focusedIndex = Math.min(tags.length - 1, focusedIndex + 1);\n newFocusedTag = tags[focusedIndex];\n }\n }\n else if (keyCode === Keys.home) {\n newFocusedTag = tags[0];\n }\n else if (keyCode === Keys.end) {\n newFocusedTag = tags[tags.length - 1];\n }\n else if (keyCode === Keys.delete) {\n if (hasFocused) {\n var items = this.value;\n removeDataItems(items, tags[focusedIndex].data, itemsKey);\n this.triggerOnChange(items, state);\n }\n }\n else if (keyCode === Keys.backspace) {\n var items = this.value;\n if (hasFocused) {\n removeDataItems(items, tags[focusedIndex].data, itemsKey);\n this.triggerOnChange(items, state);\n }\n else if (!hasFocused && tags.length) {\n var removed = tags.pop();\n removeDataItems(items, removed.data, itemsKey);\n this.triggerOnChange(items, state);\n }\n }\n if (newFocusedTag !== focusedTag) {\n state.data.focusedTag = newFocusedTag;\n state.data.activedescendant = ActiveDescendant.TagsList;\n }\n this.applyState(state);\n };\n MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {\n if (this.props.value === undefined) {\n state.data.value = __spreadArray([], items, true);\n }\n this._valueItemsDuringOnChange = [];\n this.setItems(items, this._valueItemsDuringOnChange);\n state.events.push({ type: 'onChange' });\n };\n MultiSelectWithoutContext.prototype.selectFocusedItem = function (event, itemtoSelect) {\n var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual;\n var focusedIndex = (itemtoSelect || this.getFocusedState()).focusedIndex;\n var skip = virtual ? virtual.skip : 0;\n if (data[focusedIndex - skip] !== undefined) {\n this.handleItemClick(focusedIndex, event);\n }\n };\n MultiSelectWithoutContext.prototype.setItems = function (srcItems, destItems) {\n destItems.length = 0;\n destItems.push.apply(destItems, srcItems);\n };\n MultiSelectWithoutContext.prototype.getFocusedState = function () {\n var focusedIndex = this.state.focusedIndex;\n var text = this.props.filter !== undefined ? this.props.filter : this.state.text;\n var _a = this.props, allowCustom = _a.allowCustom, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual, textField = _a.textField, _c = _a.focusedItemIndex, focusedItemIndex = _c === void 0 ? itemIndexStartsWith : _c, skipDisabledItems = _a.skipDisabledItems;\n var skip = (virtual && virtual.skip) || 0;\n var focusedInd;\n if (focusedIndex !== undefined) {\n return {\n focusedIndex: focusedIndex,\n focusedItem: data[focusedIndex - skip],\n focusedType: FocusedItemType.ListItem\n };\n }\n var selected = this.value;\n if (allowCustom && text) {\n return { focusedItem: null, focusedIndex: -1, focusedType: FocusedItemType.CustomItem };\n }\n else if (text) {\n focusedInd = focusedItemIndex(data, text, textField);\n return {\n focusedItem: data[focusedInd],\n focusedIndex: focusedInd + skip,\n focusedType: FocusedItemType.ListItem\n };\n }\n else if (selected.length) {\n var last_1 = selected[selected.length - 1];\n focusedInd = data.findIndex(function (i) { return areSame(i, last_1, dataItemKey); });\n if (data[focusedInd] !== undefined) {\n return {\n focusedIndex: focusedInd + skip,\n focusedItem: data[focusedInd],\n focusedType: FocusedItemType.ListItem\n };\n }\n return { focusedType: FocusedItemType.None, focusedIndex: -1 };\n }\n else if (skipDisabledItems && textField && !text && skip === 0) {\n var newIndex = data.findIndex(function (i) { return !i.disabled && i[textField]; });\n return {\n focusedIndex: newIndex,\n focusedItem: data[newIndex - skip],\n focusedType: FocusedItemType.ListItem\n };\n }\n return skip === 0 ?\n { focusedItem: data[0], focusedIndex: 0, focusedType: FocusedItemType.ListItem } :\n { focusedType: FocusedItemType.None, focusedIndex: -1 };\n };\n MultiSelectWithoutContext.prototype.focusElement = function (element) {\n var _this = this;\n this._skipFocusEvent = true;\n element.focus();\n window.setTimeout(function () { return _this._skipFocusEvent = false; }, 0);\n };\n MultiSelectWithoutContext.prototype.applyState = function (state) {\n this.base.applyState(state);\n this._valueItemsDuringOnChange = null;\n };\n MultiSelectWithoutContext.prototype.calculateMedia = function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n this.setState({ windowWidth: entry.target.clientWidth });\n }\n ;\n };\n ;\n MultiSelectWithoutContext.displayName = 'MultiSelect';\n /** @hidden */\n MultiSelectWithoutContext.propTypes = __assign(__assign({}, DropDownBase.propTypes), { autoClose: PropTypes.bool, value: PropTypes.arrayOf(PropTypes.any), defaultValue: PropTypes.arrayOf(PropTypes.any), dataItemKey: PropTypes.string, placeholder: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.shape({\n text: PropTypes.string,\n data: PropTypes.arrayOf(PropTypes.any)\n })), tagRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, groupField: PropTypes.string, list: PropTypes.any, adaptive: PropTypes.bool, adaptiveTitle: PropTypes.string, onCancel: PropTypes.func, skipDisabledItems: PropTypes.bool });\n /** @hidden */\n MultiSelectWithoutContext.defaultProps = __assign(__assign({}, DropDownBase.defaultProps), { autoClose: true, required: false, size: 'medium', rounded: 'medium', fillMode: 'solid', groupMode: 'modern', skipDisabledItems: true });\n return MultiSelectWithoutContext;\n}(React.Component));\nexport { MultiSelectWithoutContext };\n/**\n * Represents the PropsContext of the `MultiSelect` component.\n * Used for global configuration of all `MultiSelect` instances.\n *\n * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.\n */\nexport var MultiSelectPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).\n *\n * Accepts properties of type [MultiSelectProps]({% slug api_dropdowns_multiselectprops %}).\n * Obtaining the `ref` returns an object of type [MultiSelectHandle]({% slug api_dropdowns_multiselecthandle %}).\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * multiselect = null;\n * render() {\n * return (\n *
\n * this.multiselect = component}\n * />\n * \n *
\n * );\n * }\n * }\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nexport var MultiSelect = withPropsContext(MultiSelectPropsContext, MultiSelectWithoutContext);\nMultiSelect.displayName = 'KendoReactMultiSelect';\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { messages, pagerItemPerPage, pagerPageSizeAriaLabel } from './../messages';\nimport { DropDownList } from '@progress/kendo-react-dropdowns';\n/**\n * @hidden\n */\nvar PagerPageSizes = /** @class */ (function (_super) {\n __extends(PagerPageSizes, _super);\n function PagerPageSizes() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.pageSizeChange = function (e) {\n if (_this.props.pageChange) {\n _this.props.pageChange({ skip: 0, take: parseInt(e.target.value, 10) }, e);\n }\n };\n return _this;\n }\n PagerPageSizes.prototype.render = function () {\n var _a = this.props, value = _a.value, pageSizes = _a.pageSizes, pageSize = _a.pageSize, messagesMap = _a.messagesMap;\n var sizes = pageSizes.slice();\n if (value === undefined && sizes.filter(function (s) { return s === pageSize; }).length === 0) {\n sizes.unshift(pageSize);\n }\n var itemPerPageMessage = messagesMap ? messagesMap(pagerItemPerPage) :\n ({ messageKey: pagerItemPerPage, defaultMessage: messages[pagerItemPerPage] });\n var pageSelectionMessage = messagesMap ? messagesMap(pagerPageSizeAriaLabel) :\n ({ messageKey: pagerPageSizeAriaLabel, defaultMessage: messages[pagerPageSizeAriaLabel] });\n return (React.createElement(\"span\", { className: \"k-pager-sizes\" },\n React.createElement(DropDownList, { value: value !== undefined ? value : pageSize, data: sizes, onChange: this.pageSizeChange, ariaLabel: provideLocalizationService(this).toLanguageString(pageSelectionMessage.messageKey, pageSelectionMessage.defaultMessage), size: this.props.size }),\n React.createElement(\"span\", null, provideLocalizationService(this).toLanguageString(itemPerPageMessage.messageKey, itemPerPageMessage.defaultMessage))));\n };\n return PagerPageSizes;\n}(React.Component));\nexport { PagerPageSizes };\nregisterForLocalization(PagerPageSizes);\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-data-tools',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801765,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { PagerNumericButtons } from './PagerNumericButtons';\nimport { PagerInput } from './PagerInput';\nimport { PagerPageSizes } from './PagerPageSizes';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { messages, pagerFirstPage, pagerLastPage, pagerNextPage, pagerPreviousPage, pagerInfo, pagerAriaKeyshortcuts, pagerAriaLabel } from '../messages';\nimport { registerForIntl, registerForLocalization, provideLocalizationService, provideIntlService } from '@progress/kendo-react-intl';\nimport { classNames, kendoThemeMaps, validatePackage } from '@progress/kendo-react-common';\nimport { caretAltToLeftIcon, caretAltLeftIcon, caretAltRightIcon, caretAltToRightIcon } from '@progress/kendo-svg-icons';\nimport { packageMetadata } from '../package-metadata';\n/**\n * @hidden\n */\nvar RESPONSIVE_BREAKPOINT_MEDIUM = 600;\n/**\n * @hidden\n */\nvar RESPONSIVE_BREAKPOINT_LARGE = 768;\nvar Pager = /** @class */ (function (_super) {\n __extends(Pager, _super);\n function Pager(props) {\n var _this = _super.call(this, props) || this;\n _this._element = null;\n _this.onPageChange = function (eventData, targetEvent) {\n var event = __assign({ target: _this, syntheticEvent: targetEvent.syntheticEvent, nativeEvent: targetEvent.nativeEvent, targetEvent: targetEvent }, eventData);\n if (_this.props.onPageChange) {\n _this.props.onPageChange.call(undefined, event);\n }\n };\n _this.changePage = function (page, event) {\n if (_this.props.onPageChange && page > 0 && page <= _this.totalPages) {\n _this.props.onPageChange({\n target: _this,\n skip: (page - 1) * _this.props.take,\n take: _this.props.take,\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n targetEvent: event\n });\n }\n };\n _this.onWindowResize = function () {\n var element = _this.element;\n if (!element || !_this.props.responsive) {\n return;\n }\n var width = element.offsetWidth;\n if (width < RESPONSIVE_BREAKPOINT_MEDIUM) {\n _this.setState({ showPagerSizes: false });\n }\n else if (width >= RESPONSIVE_BREAKPOINT_MEDIUM && width < RESPONSIVE_BREAKPOINT_LARGE) {\n _this.setState({ showPagerInfo: false, showPagerSizes: true });\n }\n else {\n _this.setState({ showPagerInfo: true, showPagerSizes: true });\n }\n };\n validatePackage(packageMetadata);\n _this.state = { showPagerSizes: true, showPagerInfo: true };\n return _this;\n }\n Object.defineProperty(Pager.prototype, \"isRtl\", {\n get: function () {\n return this.props.dir === 'rtl';\n },\n enumerable: false,\n configurable: true\n });\n ;\n Object.defineProperty(Pager.prototype, \"element\", {\n /**\n * Returns the HTML element of the Pager component.\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n Pager.prototype.componentDidMount = function () {\n window.addEventListener('resize', this.onWindowResize);\n this.onWindowResize();\n };\n /**\n * @hidden\n */\n Pager.prototype.componentWillUnmount = function () {\n window.removeEventListener('resize', this.onWindowResize);\n };\n /**\n * @hidden\n */\n Pager.prototype.render = function () {\n var _a;\n var _this = this;\n var _b = this.state, showPagerSizes = _b.showPagerSizes, showPagerInfo = _b.showPagerInfo;\n var _c = this.props, skip = _c.skip, take = _c.take, total = _c.total, pageSizes = _c.pageSizes, size = _c.size, responsive = _c.responsive, messagesMap = _c.messagesMap, pageSizeValue = _c.pageSizeValue;\n var localizationService = provideLocalizationService(this);\n var intlService = provideIntlService(this);\n var currentPage = Math.floor(skip / take) + 1;\n var changer = this.props.type === 'numeric' ?\n (React.createElement(PagerNumericButtons, { type: (responsive && !showPagerSizes) ? 'dropdown' : 'numbers', buttonCount: this.props.buttonCount || 0, totalPages: this.totalPages, currentPage: currentPage, pageChange: this.changePage, messagesMap: this.props.messagesMap, size: this.props.size })) : (React.createElement(PagerInput, { buttonCount: this.props.buttonCount || 0, totalPages: this.totalPages, currentPage: currentPage, pageChange: this.changePage, messagesMap: messagesMap, size: this.props.size }));\n var firstPageMessage = messagesMap ? messagesMap(pagerFirstPage) :\n ({ messageKey: pagerFirstPage, defaultMessage: messages[pagerFirstPage] });\n var previousPageMessage = messagesMap ? messagesMap(pagerPreviousPage) :\n ({ messageKey: pagerPreviousPage, defaultMessage: messages[pagerPreviousPage] });\n var nextPageMessage = messagesMap ? messagesMap(pagerNextPage) :\n ({ messageKey: pagerNextPage, defaultMessage: messages[pagerNextPage] });\n var lastPageMessage = messagesMap ? messagesMap(pagerLastPage) :\n ({ messageKey: pagerLastPage, defaultMessage: messages[pagerLastPage] });\n var infoMessage = messagesMap ? messagesMap(pagerInfo) :\n ({ messageKey: pagerInfo, defaultMessage: messages[pagerInfo] });\n var ariaKeyshortcutsMessage = messagesMap ? messagesMap(pagerAriaKeyshortcuts) :\n ({ messageKey: pagerAriaKeyshortcuts, defaultMessage: messages[pagerAriaKeyshortcuts] });\n var ariaLabelMessage = messagesMap ? messagesMap(pagerAriaLabel) :\n ({ messageKey: pagerAriaLabel, defaultMessage: messages[pagerAriaLabel] });\n var first, prev, next, last;\n if (this.props.previousNext) {\n first = this.renderButton(1, 'k-pager-nav k-pager-first' + (currentPage === 1 ? ' k-disabled' : ''), localizationService.toLanguageString(firstPageMessage.messageKey, firstPageMessage.defaultMessage), this.isRtl ? 'caret-alt-to-right' : 'caret-alt-to-left', this.isRtl ? caretAltToRightIcon : caretAltToLeftIcon, (currentPage === 1 ? true : undefined));\n prev = this.renderButton(currentPage - 1, 'k-pager-nav' + (currentPage === 1 ? ' k-disabled' : ''), localizationService.toLanguageString(previousPageMessage.messageKey, previousPageMessage.defaultMessage), this.isRtl ? 'caret-alt-right' : 'caret-alt-left', this.isRtl ? caretAltRightIcon : caretAltLeftIcon, (currentPage === 1 ? true : undefined));\n next = this.renderButton(currentPage + 1, 'k-pager-nav' + (currentPage >= this.totalPages ? ' k-disabled' : ''), localizationService.toLanguageString(nextPageMessage.messageKey, nextPageMessage.defaultMessage), this.isRtl ? 'caret-alt-left' : 'caret-alt-right', this.isRtl ? caretAltLeftIcon : caretAltRightIcon, (currentPage >= this.totalPages ? true : undefined));\n last = this.renderButton(this.totalPages, 'k-pager-nav k-pager-last' + (currentPage >= this.totalPages ? ' k-disabled' : ''), localizationService.toLanguageString(lastPageMessage.messageKey, lastPageMessage.defaultMessage), this.isRtl ? 'caret-alt-to-left' : 'caret-alt-to-right', this.isRtl ? caretAltToLeftIcon : caretAltToRightIcon, (currentPage >= this.totalPages ? true : undefined));\n }\n var pagerPageSizes = pageSizes && (React.createElement(PagerPageSizes, { pageChange: this.onPageChange, pageSize: take, pageSizes: pageSizes, value: pageSizeValue, messagesMap: messagesMap, size: this.props.size }));\n var info = this.props.info && (React.createElement(\"span\", { className: \"k-pager-info\" }, intlService\n .format(localizationService.toLanguageString(infoMessage.messageKey, infoMessage.defaultMessage), [\n Math.min(skip + 1, total),\n Math.min(skip + take, total),\n total\n ])));\n return (React.createElement(\"div\", { className: classNames('k-pager', (_a = {},\n _a[\"k-pager-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _a), this.props.className), style: this.props.style, role: \"application\", \"aria-roledescription\": \"pager\", dir: this.props.dir, \"aria-keyshortcuts\": localizationService.toLanguageString(ariaKeyshortcutsMessage.messageKey, ariaKeyshortcutsMessage.defaultMessage), \"aria-label\": localizationService.toLanguageString(ariaLabelMessage.messageKey, ariaLabelMessage.defaultMessage), ref: function (element) { return _this._element = element; } },\n React.createElement(\"div\", { className: classNames('k-pager-numbers-wrap') },\n first,\n prev,\n changer,\n next,\n last),\n responsive ? (showPagerSizes && pagerPageSizes) : pagerPageSizes,\n responsive ? (showPagerInfo && info) : info));\n };\n Pager.prototype.renderButton = function (page, className, title, icon, svgIcon, isDisabled) {\n var _this = this;\n return (React.createElement(Button, { fillMode: 'flat', themeColor: 'base', size: this.props.size, rounded: null, className: className, icon: icon, svgIcon: svgIcon, title: title, role: \"button\", \"aria-disabled\": isDisabled, onClick: function (e) {\n e.preventDefault();\n _this.changePage(page, e);\n } }));\n };\n Object.defineProperty(Pager.prototype, \"totalPages\", {\n get: function () {\n return Math.ceil((this.props.total || 0) / this.props.take);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n Pager.propTypes = {\n className: PropTypes.string,\n style: PropTypes.object,\n total: PropTypes.number.isRequired,\n skip: PropTypes.number.isRequired,\n take: PropTypes.number.isRequired,\n buttonCount: PropTypes.number,\n info: PropTypes.bool,\n type: PropTypes.oneOf(['numeric', 'input']),\n pageSizes: PropTypes.arrayOf(PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ])),\n previousNext: PropTypes.bool,\n onPageChange: PropTypes.func,\n messagesMap: PropTypes.func,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n dir: PropTypes.string\n };\n /**\n * @hidden\n */\n Pager.defaultProps = {\n buttonCount: 10,\n info: true,\n type: 'numeric',\n size: 'medium'\n };\n return Pager;\n}(React.Component));\nexport { Pager };\nregisterForIntl(Pager);\nregisterForLocalization(Pager);\n","/**\n * A function that clones the passed date. The parameter could be `null`.\n *\n * @param date - The initial date value.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1);\n * cloneDate(null); // returns null\n * ```\n */\nexport var cloneDate = function (date) { return date ? new Date(date.getTime()) : null; };\n","import { cloneDate } from './clone-date';\n/**\n * @hidden\n */\nexport var adjustDST = function (date, hour) {\n var newDate = cloneDate(date);\n if (hour === 0 && newDate.getHours() === 23) {\n newDate.setHours(newDate.getHours() + 2);\n }\n return newDate;\n};\n","import { adjustDST } from './adjust-dst';\nimport { cloneDate } from './clone-date';\n/**\n * A function that adds and subtracts days from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of days to add and subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDays(new Date(2016, 0, 1), 5); // 2016-1-6\n * addDays(new Date(2016, 0, 1), -5); // 2015-12-26\n * ```\n */\nexport var addDays = function (date, offset) {\n var newDate = cloneDate(date);\n newDate.setDate(newDate.getDate() + offset);\n return adjustDST(newDate, date.getHours());\n};\n","import { adjustDST } from './adjust-dst';\n/**\n * A function which returns a new `Date` instance.\n *\n * @param year - The year value.\n * @param month - The month value.\n * @param day - The day value.\n * @param hours - The hours value.\n * @param minutes - The minutes value.\n * @param seconds - The seconds value.\n * @param milliseconds - milliseconds value.\n * @returns The date instance.\n *\n * @example\n * ```ts-no-run\n * createDate(2016, 0, 15); // 2016-01-15 00:00:00\n * createDate(2016, 0, 15, 22, 22, 20); // 2016-01-15 22:22:20\n * ```\n */\nexport var createDate = function (year, month, day, hours, minutes, seconds, milliseconds) {\n if (hours === void 0) { hours = 0; }\n if (minutes === void 0) { minutes = 0; }\n if (seconds === void 0) { seconds = 0; }\n if (milliseconds === void 0) { milliseconds = 0; }\n var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);\n if (year > -1 && year < 100) {\n date.setFullYear(date.getFullYear() - 1900);\n }\n return adjustDST(date, hours);\n};\n","import { addDays } from './add-days';\nimport { createDate } from './create-date';\n/**\n * A function which returns the last date of the month.\n *\n * @param date - The initial date.\n * @returns - The last date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * lastDayOfMonth(new Date(2016, 0, 15)); // 2016-01-31\n * ```\n */\nexport var lastDayOfMonth = function (date) {\n var newDate = createDate(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return addDays(newDate, -1);\n};\n","import { adjustDST } from './adjust-dst';\nimport { cloneDate } from './clone-date';\nimport { lastDayOfMonth } from './last-day-of-month';\nvar MONTHS_LENGTH = 12;\nvar normalize = function (date, expectedMonth) { return (date.getMonth() !== expectedMonth ? lastDayOfMonth(addMonths(date, -1)) : date //tslint:disable-line:no-use-before-declare\n); };\n/**\n * A function that adds and subtracts months from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of months to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addMonths(new Date(2016, 5, 1), 5); // 2016-11-1\n * addMonths(new Date(2016, 5, 1), -5); // 2015-1-1\n * ```\n */\nexport var addMonths = function (date, offset) {\n var newDate = cloneDate(date);\n var diff = (newDate.getMonth() + offset) % MONTHS_LENGTH;\n var expectedMonth = (MONTHS_LENGTH + diff) % MONTHS_LENGTH;\n newDate.setMonth(newDate.getMonth() + offset);\n return normalize(adjustDST(newDate, date.getHours()), expectedMonth);\n};\n","import { addMonths } from './add-months';\nimport { createDate } from './create-date';\nimport { lastDayOfMonth } from './last-day-of-month';\n/**\n * @hidden\n */\nexport var setYear = function (value, year) {\n var month = value.getMonth();\n var candidate = createDate(year, month, value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getMonth() === month ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n};\n","import { adjustDST } from './adjust-dst';\nimport { setYear } from './set-year';\n/**\n * A function that adds and subtracts years from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of years to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addYears(new Date(2016, 5, 1), 5); // 2011-6-1\n * addYears(new Date(2016, 5, 1), -5); // 2021-6-1\n * ```\n */\nexport var addYears = function (value, offset) {\n return adjustDST(setYear(value, value.getFullYear() + offset), value.getHours());\n};\n","import { addYears } from './add-years';\n/**\n * A function that adds and subtracts centuries from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of centuries to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addCenturies(new Date(2016, 5, 1), 5); // 2516-6-1\n * addCenturies(new Date(2016, 5, 1), -5); // 1516-6-1\n * ```\n */\nexport var addCenturies = function (value, offset) {\n return addYears(value, 100 * offset);\n};\n","import { addYears } from './add-years';\n/**\n * A function that adds and subtracts decades from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of decades to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDecades(new Date(2016, 5, 1), 5); // 2066-6-1\n * addDecades(new Date(2016, 5, 1), -5); // 1966-6-1\n * ```\n */\nexport var addDecades = function (value, offset) {\n return addYears(value, 10 * offset);\n};\n","import { addDays } from './add-days';\n/**\n * A function that adds and subtracts weeks from a Date object.\n *\n * @param date - The initial date value.\n * @param offset - The number of weeks to add/subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addWeeks(new Date(2016, 5, 1), 3); // 2016-6-22\n * addWeeks(new Date(2016, 5, 1), -3); // 2015-5-11\n * ```\n */\nexport var addWeeks = function (date, offset) {\n return addDays(date, offset * 7);\n};\n","/**\n * The number of milliseconds in one minute.\n */\nexport var MS_PER_MINUTE = 60000;\n/**\n * The number of milliseconds in one hour.\n */\nexport var MS_PER_HOUR = 3600000;\n/**\n * The number of milliseconds in one standard day.\n */\nexport var MS_PER_DAY = 86400000;\n","// tslint:disable:max-line-length\n/**\n * An enumeration which represents the horizontal direction. The `Forward` option moves forward. The `Backward` option moves backward.\n */\nexport var Direction;\n(function (Direction) {\n /**\n * The `Forward` value with an underlying `1` number value.\n */\n Direction[Direction[\"Forward\"] = 1] = \"Forward\";\n /**\n * The `Backward` value with an underlying `-1` (minus one) number value.\n */\n Direction[Direction[\"Backward\"] = -1] = \"Backward\";\n})(Direction || (Direction = {}));\n// tslint:enable:max-line-length\n","import { Direction } from \"./direction.enum\";\nimport { adjustDST } from \"./adjust-dst\";\nimport { cloneDate } from './clone-date';\n/**\n * @hidden\n *\n * A function which returns the next or previous date for a specific week day. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @param direction - The `Direction` enum specifying the calculation direction.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday\n * ```\n */\nexport var dayOfWeek = function (date, weekDay, direction) {\n if (direction === void 0) { direction = Direction.Forward; }\n var newDate = cloneDate(date);\n var newDay = ((weekDay - newDate.getDay()) + (7 * direction)) % 7;\n newDate.setDate(newDate.getDate() + newDay);\n return adjustDST(newDate, date.getHours());\n};\n","/**\n * Enumeration which represents the week days.\n */\nexport var Day;\n(function (Day) {\n /**\n * The Sunday value with an underlying `0` number value.\n */\n Day[Day[\"Sunday\"] = 0] = \"Sunday\";\n /**\n * The Monday value with an underlying `1` number value.\n */\n Day[Day[\"Monday\"] = 1] = \"Monday\";\n /**\n * The Tuesday value with an underlying `2` number value.\n */\n Day[Day[\"Tuesday\"] = 2] = \"Tuesday\";\n /**\n * The Wednesday value with an underlying `3` number value.\n */\n Day[Day[\"Wednesday\"] = 3] = \"Wednesday\";\n /**\n * The Thursday value with an underlying `4` number value.\n */\n Day[Day[\"Thursday\"] = 4] = \"Thursday\";\n /**\n * The Friday value with an underlying `5` number value.\n */\n Day[Day[\"Friday\"] = 5] = \"Friday\";\n /**\n * The Saturday value with an underlying `6` number value.\n */\n Day[Day[\"Saturday\"] = 6] = \"Saturday\";\n})(Day || (Day = {}));\n","import { setYear } from './set-year';\n/**\n * @hidden\n */\nexport var normalizeYear = function (value, year) { return (setYear(value, year(value.getFullYear()))); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the first decade in a century.\n *\n * @param date - The start date value.\n * @returns - The first year in a century.\n *\n * @example\n * ```ts-no-run\n * firstDecadeOfCentury(new Date(2017, 0, 1)); // 2000-1-1\n * firstDecadeOfCentury(new Date(2007, 10, 22)); // 2000-11-22\n * firstDecadeOfCentury(new Date(2126, 0, 1)); // 2100-1-1\n * ```\n */\nexport var firstDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100); })); };\n","import { firstDecadeOfCentury } from './first-decade-of-century';\n/**\n * A function that calculates duration in centuries between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInCenturies(new Date(2016, 0, 1), new Date(3216, 0, 1)); // 12\n * durationInCenturies(new Date(2016, 6, 1), new Date(2617, 0, 1)); // 6\n * durationInCenturies(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInCenturies = function (start, end) { return ((firstDecadeOfCentury(end).getFullYear() - firstDecadeOfCentury(start).getFullYear()) / 100); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the first year in a decade.\n *\n * @param date - The start date value.\n * @returns - The first year in a decade.\n *\n * @example\n * ```ts-no-run\n * firstYearOfDecade(new Date(2017, 0, 1)); // 2010-1-1\n * firstYearOfDecade(new Date(2007, 10, 22)); // 2000-11-22\n * firstYearOfDecade(new Date(2026, 0, 1)); // 2020-1-1\n * ```\n */\nexport var firstYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10); })); };\n","import { firstYearOfDecade } from './first-year-of-decade';\n/**\n * A function that calculates duration in decades between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInDecades(new Date(2016, 0, 1), new Date(2136, 0, 1)); // 12\n * durationInDecades(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInDecades = function (start, end) { return ((firstYearOfDecade(end).getFullYear() - firstYearOfDecade(start).getFullYear()) / 10); };\n","/**\n * A function that calculates duration in months between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInMonths(new Date(2016, 0, 1), new Date(2017, 0, 1)); // 12\n * durationInMonths(new Date(2016, 6, 1), new Date(2017, 0, 1)); // 6\n * durationInMonths(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInMonths = function (start, end) { return (((end.getFullYear() - start.getFullYear())) * 12 + (end.getMonth() - start.getMonth())); };\n","/**\n * A function that calculates duration in years between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in years.\n *\n * @example\n * ```ts-no-run\n * durationInYears(new Date(2016, 0, 1), new Date(2028, 0, 1)); // 12\n * durationInYears(new Date(2016, 0, 1), new Date(2022, 0, 1)); // 6\n * durationInYears(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInYears = function (start, end) { return (end.getFullYear() - start.getFullYear()); };\n","import { createDate } from './create-date';\n/**\n * A function which returns the first date of the month.\n *\n * @param date - The initial date.\n * @returns - The first date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * firstDayOfMonth(new Date(2016, 0, 15)); // 2016-01-01\n * ```\n */\nexport var firstDayOfMonth = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n};\n","import { addMonths } from './add-months';\nimport { createDate } from './create-date';\nimport { lastDayOfMonth } from './last-day-of-month';\n/**\n * @hidden\n */\nexport var setMonth = function (value, month) {\n var day = value.getDate();\n var candidate = createDate(value.getFullYear(), month, day, value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getDate() === day ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n};\n","import { setMonth } from './set-month';\n/**\n * A function that returns a `Date` object of the first month in a year.\n *\n * @param date - The start date value.\n * @returns - The first month in a year.\n *\n * @example\n * ```ts-no-run\n * firstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1\n * firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1\n * ```\n */\nexport var firstMonthOfYear = function (value) { return setMonth(value, 0); };\n","import { createDate } from './create-date';\n/**\n * A function which returns the passed date with a midnight time portion.\n *\n * @param date - The initial date.\n * @returns - The date with a midnight time portion.\n *\n * @example\n * ```ts-no-run\n * getDate(new Date(2016, 0, 15, 14, 30, 30)); // 2016-01-15 00:00:00\n * ```\n */\nexport var getDate = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n};\n","/**\n * A function that compares two dates. The comparison also includes the time portion.\n *\n * @param candidate - The candidate date.\n * @param expected - The expected date.\n * @returns - A Boolean value indicating whether the values are equal.\n *\n * @example\n * ```ts-no-run\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 1)); // true\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 2)); // false\n * isEqual(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // false\n * ```\n */\nexport var isEqual = function (candidate, expected) {\n if (!candidate && !expected) {\n return true;\n }\n return candidate && expected && candidate.getTime() === expected.getTime();\n};\n","import { getDate } from './get-date';\nimport { isEqual } from './is-equal';\n/**\n * A function that compares the date portions of 2 dates.\n *\n * @param candidate - The candidate date.\n * @param expected - The expected date.\n * @returns - A Boolean value whether the values are equal.\n *\n * @example\n * ```ts-no-run\n * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // true\n * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 2, 10)); // false\n * ```\n */\nexport var isEqualDate = function (candidate, expected) {\n if (!candidate && !expected) {\n return true;\n }\n return candidate && expected && isEqual(getDate(candidate), getDate(expected));\n};\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the last decade in a century.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastDecadeOfCentury(new Date(2017, 0, 1)); // 2090-1-1\n * lastDecadeOfCentury(new Date(2007, 10, 22)); // 2090-11-22\n * lastDecadeOfCentury(new Date(2126, 0, 1)); // 2190-1-1\n * ```\n */\nexport var lastDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100) + 90; })); };\n","import { setMonth } from './set-month';\n/**\n * A function that returns a `Date` object of the last month in a year.\n *\n * @param date - The start date value.\n * @returns - The last month in a year.\n *\n * @example\n * ```ts-no-run\n * lastMonthOfYear(new Date(2017, 5, 3)); // 2017-12-3\n * lastMonthOfYear(new Date(2017, 11, 3)); // 2017-12-3\n * ```\n */\nexport var lastMonthOfYear = function (value) { return setMonth(value, 11); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the last year in a decade.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastYearOfDecade(new Date(2017, 0, 1)); // 2019-1-1\n * lastYearOfDecade(new Date(2007, 10, 22)); // 2009-11-22\n * lastYearOfDecade(new Date(2026, 0, 1)); // 2029-1-1\n * ```\n */\nexport var lastYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10) + 9; })); };\n","import { Direction } from \"./direction.enum\";\nimport { dayOfWeek } from './day-of-week';\n/**\n * A function which returns a date by a specific week name. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * prevDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2015-12-30, Wednesday\n * ```\n */\nexport var prevDayOfWeek = function (date, weekDay) {\n return dayOfWeek(date, weekDay, Direction.Backward);\n};\n","import { Day } from './day.enum';\nimport { addDays } from './add-days';\nimport { createDate } from './create-date';\nimport { prevDayOfWeek } from './prev-day-of-week';\nimport { MS_PER_DAY } from './constants';\nimport { getDate } from './get-date';\nvar moveDateToWeekStart = function (date, weekStartDay) {\n if (weekStartDay !== Day.Monday) {\n return addDays(prevDayOfWeek(date, weekStartDay), 4);\n }\n return addDays(date, (4 - (date.getDay() || 7)));\n};\nvar calcWeekInYear = function (date, weekStartDay) {\n var firstWeekInYear = createDate(date.getFullYear(), 0, 1, -6);\n var newDate = moveDateToWeekStart(date, weekStartDay);\n var diffInMS = newDate.getTime() - firstWeekInYear.getTime();\n var days = Math.floor(diffInMS / MS_PER_DAY);\n return 1 + Math.floor(days / 7);\n};\n/**\n * A function that returns the number of the week within a year, which is calculated in relation to the date.\n *\n * For more information, refer to the [**ISO week date**](https://en.wikipedia.org/wiki/ISO_week_date) article.\n *\n * @param date - The date used for the week number calculation.\n * @param weekStartDay - The first day of the week. By default, the first week day is Monday.\n * @returns - The number of the week within the year.\n *\n * @example\n * ```ts-no-run\n * weekInYear(new Date(2016, 0, 1)); // Week 53, 2015\n * weekInYear(new Date(2016, 0, 5)); // Week 1, 2016\n * weekInYear(new Date(2017, 0, 1)); // Week 52, 2016\n * weekInYear(new Date(2017, 0, 2)); // Week 1, 2017\n * ```\n */\nexport var weekInYear = function (date, weekStartDay) {\n if (weekStartDay === void 0) { weekStartDay = Day.Monday; }\n date = getDate(date);\n var prevWeekDate = addDays(date, -7);\n var nextWeekDate = addDays(date, 7);\n var weekNumber = calcWeekInYear(date, weekStartDay);\n if (weekNumber === 0) {\n return calcWeekInYear(prevWeekDate, weekStartDay) + 1;\n }\n if (weekNumber === 53 && calcWeekInYear(nextWeekDate, weekStartDay) > 1) {\n return 1;\n }\n return weekNumber;\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-dateinputs',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695801386,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * @hidden\n */\nvar update = function (arr, idx, value) { return (__spreadArray(__spreadArray([], arr.slice(0, idx + 1), true), (arr.slice(idx + 1).map(function (x) { return x + value; })), true)); };\n/**\n * @hidden\n */\nvar RowHeightService = /** @class */ (function () {\n function RowHeightService(total, rowHeight, detailRowHeight) {\n if (total === void 0) { total = 0; }\n this.total = total;\n this.rowHeight = rowHeight;\n this.detailRowHeight = detailRowHeight;\n this.offsets = [];\n this.heights = [];\n var agg = 0;\n for (var idx = 0; idx < total; idx++) {\n this.offsets.push(agg);\n agg += rowHeight;\n this.heights.push(rowHeight);\n }\n }\n RowHeightService.prototype.height = function (rowIndex) {\n return this.heights[rowIndex];\n };\n RowHeightService.prototype.expandDetail = function (rowIndex) {\n if (this.height(rowIndex) === this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight);\n }\n };\n RowHeightService.prototype.collapseDetail = function (rowIndex) {\n if (this.height(rowIndex) > this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight * -1);\n }\n };\n RowHeightService.prototype.index = function (position) {\n for (var i = 0; i < this.offsets.length; i++) {\n if (position === this.offsets[i]) {\n return i;\n }\n if (position < this.offsets[i]) {\n return i - 1;\n }\n }\n return this.total - 1;\n };\n RowHeightService.prototype.offset = function (rowIndex) {\n return this.offsets[rowIndex];\n };\n RowHeightService.prototype.totalHeight = function () {\n return this.heights.reduce(function (prev, curr) { return prev + curr; }, 0);\n };\n RowHeightService.prototype.updateRowHeight = function (rowIndex, value) {\n this.heights[rowIndex] += value;\n this.offsets = update(this.offsets, rowIndex, value);\n };\n return RowHeightService;\n}());\nexport { RowHeightService };\n","var normalize = function (x) { return Math.max(x, 0); };\n/**\n * @hidden\n */\nvar ScrollAction = /** @class */ (function () {\n function ScrollAction(offset) {\n this.offset = offset;\n }\n return ScrollAction;\n}());\nexport { ScrollAction };\n/**\n * @hidden\n */\nvar PageAction = /** @class */ (function () {\n function PageAction(skip) {\n this.skip = skip;\n }\n return PageAction;\n}());\nexport { PageAction };\n/**\n * @hidden\n */\nvar ScrollerService = /** @class */ (function () {\n function ScrollerService(onScrollAction, onPageAction) {\n this.onScrollAction = onScrollAction;\n this.onPageAction = onPageAction;\n this.direction = 'vertical';\n this.firstLoaded = 0;\n this.lastLoaded = 0;\n this.lastScrollTop = 0;\n this.take = 0;\n this.total = 0;\n this.rowHeightService = null;\n this.bottomOffset = 0;\n this.topOffset = 0;\n }\n ScrollerService.prototype.create = function (rowHeightService, skip, take, total, topOffset, bottomOffset, direction) {\n if (topOffset === void 0) { topOffset = 0; }\n if (bottomOffset === void 0) { bottomOffset = 0; }\n if (direction === void 0) { direction = 'vertical'; }\n this.rowHeightService = rowHeightService;\n this.firstLoaded = skip;\n this.lastLoaded = skip + take;\n this.take = take;\n this.total = total;\n this.lastScrollTop = 0;\n this.topOffset = topOffset;\n this.bottomOffset = bottomOffset;\n this.direction = direction;\n var offsetBufferRows = this.rowsForHeight(topOffset);\n var skipWithOffset = normalize(skip - offsetBufferRows);\n this.onScrollAction(new ScrollAction(this.rowOffset(skipWithOffset)));\n this.onPageAction(new PageAction(skipWithOffset));\n };\n ScrollerService.prototype.onScroll = function (_a) {\n var scrollLeft = _a.scrollLeft, scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight, offsetWidth = _a.offsetWidth;\n var scrollPosition = this.direction === 'vertical' ? scrollTop : scrollLeft;\n var offsetSize = this.direction === 'vertical' ? offsetHeight : offsetWidth;\n if (this.lastScrollTop === scrollPosition || !this.rowHeightService) {\n return;\n }\n var up = this.lastScrollTop >= scrollPosition;\n this.lastScrollTop = scrollPosition;\n var firstItemIndex = this.rowHeightService.index(normalize(scrollPosition - this.topOffset));\n var lastItemIndex = this.rowHeightService.index(normalize(scrollPosition + offsetSize - this.bottomOffset));\n if (!up && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {\n this.firstLoaded = firstItemIndex;\n this.onScrollAction(new ScrollAction(this.rowOffset(firstItemIndex)));\n this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);\n this.onPageAction(new PageAction(this.firstLoaded));\n }\n if (up && firstItemIndex <= this.firstLoaded) {\n var nonVisibleBuffer = Math.floor(this.take * 0.3);\n this.firstLoaded = normalize(firstItemIndex - nonVisibleBuffer);\n this.onScrollAction(new ScrollAction(this.rowOffset(this.firstLoaded)));\n this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);\n this.onPageAction(new PageAction(this.firstLoaded));\n }\n };\n ScrollerService.prototype.rowOffset = function (index) {\n return this.rowHeightService ? this.rowHeightService.offset(index) + this.topOffset : 0;\n };\n ScrollerService.prototype.rowsForHeight = function (height) {\n return this.rowHeightService ? Math.ceil(height / this.rowHeightService.height(0)) : 0;\n };\n return ScrollerService;\n}());\nexport { ScrollerService };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar _a, _b, _c;\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\nimport { RowHeightService, ScrollerService } from './services';\n/**\n * @hidden\n */\nexport var ScrollDirection;\n(function (ScrollDirection) {\n ScrollDirection[ScrollDirection[\"Backward\"] = 0] = \"Backward\";\n ScrollDirection[ScrollDirection[\"Forward\"] = 1] = \"Forward\";\n})(ScrollDirection || (ScrollDirection = {}));\nvar differenceToScroll = function (scrollTop, staticOffset, maxScrollDifference) {\n return Math.min(Math.abs(staticOffset - scrollTop), maxScrollDifference);\n};\nvar FRAME_DURATION = 17;\nvar scrollModifiers = (_a = {},\n _a[ScrollDirection.Forward] = function (step) { return function (value) { return value + step; }; },\n _a[ScrollDirection.Backward] = function (step) { return function (value) { return value - step; }; },\n _a);\nvar scrollNormalizers = (_b = {},\n _b[ScrollDirection.Forward] = function (end) { return function (value) { return Math.min(value, end); }; },\n _b[ScrollDirection.Backward] = function (end) { return function (value) { return Math.max(value, end); }; },\n _b);\nvar scrollValidators = (_c = {},\n _c[ScrollDirection.Forward] = function (end) { return function (start) { return start < end; }; },\n _c[ScrollDirection.Backward] = function (end) { return function (start) { return start > end; }; },\n _c);\n/**\n * @hidden\n */\nvar Virtualization = /** @class */ (function (_super) {\n __extends(Virtualization, _super);\n function Virtualization(props) {\n var _this = _super.call(this, props) || this;\n _this.rowHeightService = null;\n _this.scrollContainer = null;\n _this.lastDirection = null;\n _this.lastTotal = 0;\n _this.lastTake = 0;\n _this.animationInProgress = false;\n _this.scrollTo = function (value) {\n var scrollProperty = _this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft';\n if (!_this.scrollContainer) {\n return;\n }\n _this.scrollContainer[scrollProperty] = value;\n };\n _this.scrollToIndex = function (index) {\n _this.animationInProgress = false;\n if (_this.rowHeightService) {\n _this.scrollTo(_this.rowHeightService.offset(index));\n }\n };\n _this.animateToIndex = function (index) {\n if (!_this.rowHeightService || !window) {\n return;\n }\n window.cancelAnimationFrame(_this.cancelAnimation);\n var indexOffset = _this.rowHeightService.offset(index);\n var direction = _this.getContainerScrollDirection(indexOffset);\n var _a = _this.scrollRange(indexOffset, direction), start = _a.start, end = _a.end;\n if (start === end) {\n return;\n }\n var step = _this.scrollStep(start, end);\n var modifyScroll = scrollModifiers[direction](step);\n var normalizeScroll = scrollNormalizers[direction](end);\n var isScrollValid = scrollValidators[direction](modifyScroll(end));\n var animate = function (progress) {\n _this.animationInProgress = true;\n var next = modifyScroll(progress);\n _this.scrollTo(normalizeScroll(next));\n isScrollValid(next)\n ? _this.cancelAnimation = window.requestAnimationFrame(function () { animate(next); })\n : _this.animationInProgress = false;\n };\n _this.cancelAnimation = window.requestAnimationFrame(function () { animate(start); });\n };\n _this.scrollToBottom = function () {\n if (!_this.rowHeightService) {\n return;\n }\n _this.scrollTo(_this.rowHeightService.totalHeight() + _this.props.bottomOffset);\n };\n _this.scrollStep = function (start, end) {\n var duration = _this.props.scrollDuration || Virtualization.defaultProps.scrollDuration;\n return Math.abs(end - start) / (duration / FRAME_DURATION);\n };\n _this.scrollRange = function (indexOffset, direction) {\n var containerScroll = _this.containerScrollPosition;\n if (parseInt(\"\".concat(indexOffset), 10) === parseInt(\"\".concat(containerScroll), 10)) {\n return { start: indexOffset, end: indexOffset };\n }\n var maxScroll = _this.containerMaxScroll();\n var sign = direction === ScrollDirection.Backward ? 1 : -1;\n var difference = differenceToScroll(containerScroll, indexOffset, _this.props.maxScrollDifference || 0);\n var end = Math.min(indexOffset, maxScroll);\n var start = Math.min(Math.max(end + (sign * difference), 0), maxScroll);\n return { start: start, end: end };\n };\n _this.containerMaxScroll = function () {\n return _this.containerScrollSize - _this.containerOffsetSize;\n };\n _this.getContainerScrollDirection = function (indexOffset) {\n return indexOffset < _this.containerScrollPosition ? ScrollDirection.Backward : ScrollDirection.Forward;\n };\n _this.initServices = function (props) {\n if (props === void 0) { props = _this.props; }\n var dimension = _this.direction === 'vertical' ? props.itemHeight : props.itemWidth;\n if (dimension === undefined) {\n return;\n }\n _this.rowHeightService = new RowHeightService(props.total, dimension, 0);\n _this.scrollerService.create(_this.rowHeightService, props.skip, props.take, props.total, props.topOffset, _this.scrollOffsetSize, _this.direction);\n };\n _this.getContainerProperty = function (propertyName) {\n if (!_this.scrollContainer) {\n return 0;\n }\n return _this.scrollContainer[propertyName];\n };\n _this.handleScroll = function (event) {\n if (!_this.scrollContainer || !_this.rowHeightService) {\n return;\n }\n var target = event.target;\n _this.scrollerService.onScroll({\n scrollLeft: target.scrollLeft,\n scrollTop: target.scrollTop,\n offsetHeight: target.offsetHeight,\n offsetWidth: target.offsetWidth\n });\n var index = _this.rowHeightService.index(_this.containerScrollPosition - _this.props.topOffset);\n var onScrollAction = _this.props.onScrollAction;\n var args = {\n index: index,\n target: target,\n scrollAction: _this.scrollAction,\n pageAction: _this.pageAction,\n animationInProgress: _this.animationInProgress\n };\n if (_this.props.onScroll) {\n _this.props.onScroll.call(undefined, event);\n }\n if (onScrollAction) {\n onScrollAction.call(undefined, args);\n }\n _this.scrollAction = undefined;\n _this.pageAction = undefined;\n };\n _this.handleScrollAction = function (action) {\n _this.scrollAction = action;\n };\n _this.handlePageAction = function (action) {\n _this.pageAction = action;\n };\n _this.scrollerService = new ScrollerService(_this.handleScrollAction, _this.handlePageAction);\n return _this;\n }\n Object.defineProperty(Virtualization.prototype, \"element\", {\n get: function () {\n return this.scrollContainer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Virtualization.prototype, \"containerOffsetSize\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'offsetHeight' : 'offsetWidth');\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Virtualization.prototype, \"containerScrollSize\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'scrollHeight' : 'scrollWidth');\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Virtualization.prototype, \"containerScrollPosition\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft');\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Virtualization.prototype, \"direction\", {\n get: function () {\n return this.props.direction !== undefined ? this.props.direction : Virtualization.defaultProps.direction;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Virtualization.prototype, \"scrollOffsetSize\", {\n get: function () {\n return this.props.scrollOffsetSize !== undefined\n ? this.props.scrollOffsetSize : Virtualization.defaultProps.scrollOffsetSize;\n },\n enumerable: false,\n configurable: true\n });\n Virtualization.prototype.activeIndex = function () {\n return this.itemIndex(Math.ceil(this.containerScrollPosition));\n };\n Virtualization.prototype.itemIndex = function (offset) {\n if (!this.rowHeightService) {\n return 0;\n }\n return this.rowHeightService.index(offset);\n };\n Virtualization.prototype.itemOffset = function (index) {\n if (!this.rowHeightService) {\n return 0;\n }\n return this.rowHeightService.offset(index);\n };\n Virtualization.prototype.isIndexVisible = function (index) {\n if (!this.rowHeightService) {\n return false;\n }\n var containerTop = this.containerScrollPosition;\n var containerBottom = containerTop + this.containerOffsetSize;\n var top = this.rowHeightService.offset(index);\n var bottom = top + this.rowHeightService.height(index);\n return top >= containerTop && bottom <= containerBottom;\n };\n Virtualization.prototype.isListScrolled = function (index) {\n if (!this.rowHeightService) {\n return false;\n }\n return this.containerScrollPosition !== this.rowHeightService.offset(index);\n };\n Virtualization.prototype.componentDidMount = function () {\n var onMount = this.props.onMount;\n if (onMount) {\n onMount.call(undefined, this);\n }\n };\n Virtualization.prototype.render = function () {\n var _this = this;\n if (this.lastTotal !== this.props.total\n || this.lastDirection !== this.direction\n || this.lastTake !== this.props.take) {\n this.initServices();\n this.lastTotal = this.props.total;\n this.lastDirection = this.direction;\n this.lastTake = this.props.take;\n }\n var vertexLength = \"\".concat((this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.props.bottomOffset);\n var placeholderStyle = this.direction === 'vertical'\n ? { height: \"\".concat(vertexLength, \"px\") }\n : { width: \"\".concat(vertexLength, \"px\") };\n var rootClassNames = classNames('k-content k-scrollable', {\n 'k-scrollable-horizontal': this.direction === 'horizontal'\n }, this.props.className);\n var scrollableClassNames = classNames('k-scrollable-placeholder', {\n 'k-scrollable-horizontal-placeholder': this.direction === 'horizontal'\n });\n return (React.createElement(\"div\", { ref: function (el) { _this.scrollContainer = el; }, onScroll: this.handleScroll, className: rootClassNames, tabIndex: this.props.tabIndex, role: this.props.role },\n this.props.children,\n React.createElement(\"div\", { style: placeholderStyle, className: scrollableClassNames })));\n };\n Virtualization.propTypes = {\n bottomOffset: PropTypes.number.isRequired,\n className: PropTypes.string,\n direction: PropTypes.oneOf(['horizontal', 'vertical']),\n forceScroll: PropTypes.bool,\n itemHeight: PropTypes.number,\n itemWidth: PropTypes.number,\n maxScrollDifference: PropTypes.number,\n onScroll: PropTypes.func,\n onScrollAction: PropTypes.func,\n scrollDuration: PropTypes.number,\n scrollOffsetSize: PropTypes.number,\n skip: PropTypes.number.isRequired,\n tabIndex: PropTypes.number,\n take: PropTypes.number.isRequired,\n topOffset: PropTypes.number.isRequired,\n total: PropTypes.number.isRequired,\n role: PropTypes.string\n };\n Virtualization.defaultProps = {\n direction: 'vertical',\n forceScroll: false,\n scrollOffsetSize: 0,\n maxScrollDifference: 100,\n scrollDuration: 100\n };\n return Virtualization;\n}(React.Component));\nexport { Virtualization };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar compareProps = function (x, y) {\n var xProps = Object.getOwnPropertyNames(x);\n var yProps = Object.getOwnPropertyNames(y);\n if (xProps.length !== yProps.length) {\n return false;\n }\n for (var i = 0; i < xProps.length; i++) {\n var propName = xProps[i];\n if (x[propName] !== y[propName]) {\n return false;\n }\n }\n return true;\n};\n/**\n * The `CalendarCell` component is internally used for rendering the items in the current view. Also be used as a custom `cell` of the [Calendar]({% slug api_dateinputs_calendarprops %}#toc-cell) and the [MultiViewCalendar]({% slug api_dateinputs_multiviewcalendarprops %}#toc-cell).\n *\n * * [Customizing the cells inside the Calendar view]({% slug custom_rendering_calendar %}#toc-cells-inside-the-view)\n * * [Customizing the cells inside the MultiViewCalendar view]({% slug custom_rendering_multiviewcalendar %}#toc-cells-inside-the-view)\n */\nvar CalendarCell = /** @class */ (function (_super) {\n __extends(CalendarCell, _super);\n function CalendarCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // tslint:enable:max-line-length\n _this.handleClick = function (event) {\n var _a = _this.props, onClick = _a.onClick, value = _a.value;\n if (onClick) {\n onClick.call(undefined, value, event);\n }\n };\n _this.handleMouseEnter = function () {\n var _a = _this.props, onMouseEnter = _a.onMouseEnter, value = _a.value;\n if (onMouseEnter) {\n onMouseEnter.call(undefined, value);\n }\n };\n _this.handleMouseLeave = function () {\n var _a = _this.props, onMouseLeave = _a.onMouseLeave, value = _a.value;\n if (onMouseLeave) {\n onMouseLeave.call(undefined, value);\n }\n };\n return _this;\n }\n // Manually checking if the component needs an update\n // due to date object being compared by instance\n // and new Date object is created\n // every time and fails the shallow compare of the React.PureComponent.\n /**\n * @hidden\n */\n CalendarCell.prototype.shouldComponentUpdate = function (nextProps) {\n var _a = this.props, value = _a.value, props = __rest(_a, [\"value\"]);\n var newValue = nextProps.value, newProps = __rest(nextProps, [\"value\"]);\n var valueEqual = !(value && newValue) || value.getTime() === newValue.getTime();\n return !(valueEqual && compareProps(props, newProps));\n };\n /* eslint-disable max-len */\n /**\n * @return\n * Returns a `` element with a `` inside to apply the styles. The text inside is the [`formattedValue`]({% slug api_dateinputs_calendarcellprops %}#toc-formattedvalue) of the `cell`.\n */\n CalendarCell.prototype.render = function () {\n var _a = this.props, className = _a.className, formattedValue = _a.formattedValue, isWeekend = _a.isWeekend, isFocused = _a.isFocused, isInRange = _a.isInRange, isSelected = _a.isSelected, isRangeStart = _a.isRangeStart, isRangeMid = _a.isRangeMid, isRangeEnd = _a.isRangeEnd, isRangeSplitStart = _a.isRangeSplitStart, isRangeSplitEnd = _a.isRangeSplitEnd, isToday = _a.isToday, isDisabled = _a.isDisabled, view = _a.view, value = _a.value, other = __rest(_a, [\"className\", \"formattedValue\", \"isWeekend\", \"isFocused\", \"isInRange\", \"isSelected\", \"isRangeStart\", \"isRangeMid\", \"isRangeEnd\", \"isRangeSplitStart\", \"isRangeSplitEnd\", \"isToday\", \"isDisabled\", \"view\", \"value\"]);\n var isEndActive = this.props.activeRangeEnd === 'end' && isRangeEnd;\n var isStartActive = this.props.activeRangeEnd === 'start' && isRangeStart;\n var rootClassName = classNames('k-calendar-td', {\n 'k-range-end': isRangeEnd,\n 'k-range-mid': isRangeMid,\n 'k-range-split-end': isRangeSplitEnd,\n 'k-range-split-start': isRangeSplitStart,\n 'k-range-start': isRangeStart,\n 'k-active': isStartActive || isEndActive,\n 'k-state-pending-focus': isFocused,\n 'k-selected': isSelected || isRangeStart || isRangeEnd,\n 'k-today': isToday,\n 'k-weekend': isWeekend,\n 'k-disabled': isDisabled\n }, className);\n return (React.createElement(\"td\", __assign({}, other, { className: rootClassName, onClick: this.handleClick, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }),\n React.createElement(\"span\", { className: \"k-link\" }, this.props.children)));\n };\n return CalendarCell;\n}(React.Component));\nexport { CalendarCell };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * The `CalendarWeekCell` component is internally used for rendering the week cells inside the `month` view of the Calendar. Also used as a [custom week cell for the Calendar]({% slug api_dateinputs_calendarprops %}#toc-weekcell) and the [MultiViewCalendar]({% slug api_dateinputs_multiviewcalendarprops %}#toc-weekcell) components.\n *\n * * [Customizing week-column cells in the Calendar]({% slug custom_rendering_calendar %}#toc-cells-inside-the-week-column)\n * * [Customizing week-column cells in the MultiViewCalendar]({% slug custom_rendering_multiviewcalendar %}#toc-cells-inside-the-week-column)\n */\nvar CalendarWeekCell = /** @class */ (function (_super) {\n __extends(CalendarWeekCell, _super);\n function CalendarWeekCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return\n * Returns a `` element with the [`value`]({% slug api_dateinputs_calendarweekcellprops %}#toc-value) as a child.\n */\n CalendarWeekCell.prototype.render = function () {\n var _a = this.props, className = _a.className, firstDate = _a.firstDate, other = __rest(_a, [\"className\", \"firstDate\"]);\n return (React.createElement(\"td\", __assign({ className: classNames('k-calendar-td', className) }, other), this.props.children));\n };\n return CalendarWeekCell;\n}(React.Component));\nexport { CalendarWeekCell };\n","/**\n * @hidden\n */\nexport var Action;\n(function (Action) {\n Action[Action[\"Left\"] = 0] = \"Left\";\n Action[Action[\"Right\"] = 1] = \"Right\";\n Action[Action[\"Up\"] = 2] = \"Up\";\n Action[Action[\"Down\"] = 3] = \"Down\";\n Action[Action[\"PrevView\"] = 4] = \"PrevView\";\n Action[Action[\"NextView\"] = 5] = \"NextView\";\n Action[Action[\"FirstInView\"] = 6] = \"FirstInView\";\n Action[Action[\"LastInView\"] = 7] = \"LastInView\";\n Action[Action[\"LowerView\"] = 8] = \"LowerView\";\n Action[Action[\"UpperView\"] = 9] = \"UpperView\";\n})(Action || (Action = {}));\n","/**\n * The Enum which defines all possible Calendar view types.\n */\nexport var CalendarViewEnum;\n(function (CalendarViewEnum) {\n CalendarViewEnum[CalendarViewEnum[\"month\"] = 0] = \"month\";\n CalendarViewEnum[CalendarViewEnum[\"year\"] = 1] = \"year\";\n CalendarViewEnum[CalendarViewEnum[\"decade\"] = 2] = \"decade\";\n CalendarViewEnum[CalendarViewEnum[\"century\"] = 3] = \"century\";\n})(CalendarViewEnum || (CalendarViewEnum = {}));\n","/**\n * @hidden\n */\nexport var EMPTY_SELECTIONRANGE = { start: null, end: null };\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { cloneDate, isEqual } from '@progress/kendo-date-math';\nimport { getDate } from '@progress/kendo-date-math';\nimport { EMPTY_SELECTIONRANGE } from './calendar/models/SelectionRange';\n/**\n * @hidden\n */\nexport var isEqualRange = function (initial, updated) {\n var _a = initial || EMPTY_SELECTIONRANGE, initialStart = _a.start, initialEnd = _a.end;\n var _b = updated || EMPTY_SELECTIONRANGE, updatedStart = _b.start, updatedEnd = _b.end;\n if (initialStart === null || initialEnd === null || updatedStart === null || updatedEnd === null) {\n return false;\n }\n return isEqual(initialStart, updatedStart) && isEqual(initialEnd, updatedEnd);\n};\n// Polyfill for PropTypes.null\n/**\n * @hidden\n */\nexport function nullable(subRequirement) {\n var check = function (required, props, key) {\n var rest = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n rest[_i - 3] = arguments[_i];\n }\n if (props[key] === null) {\n return null;\n }\n var sub = required ? subRequirement.isRequired : subRequirement;\n return sub.apply(void 0, __spreadArray([props, key], rest, false));\n };\n var fn = check.bind(null, false);\n fn.isRequired = check.bind(null, true);\n return fn;\n}\n/**\n * @hidden\n */\nexport var viewInRange = function (candidate, min, max) {\n if (min === undefined || max === undefined) {\n return candidate;\n }\n return min <= candidate && candidate <= max\n ? candidate\n : candidate < min\n ? min\n : max;\n};\n/**\n * @hidden\n */\nexport var MIDNIGHT_DATE = new Date(1980, 0, 1);\n/**\n * @hidden\n */\nexport var MIN_DATE = new Date(1900, 0, 1);\n/**\n * @hidden\n */\nexport var MAX_DATE = new Date(2099, 11, 31);\n/**\n * @hidden\n */\nexport var MIN_TIME = new Date(1980, 0, 1);\n/**\n * @hidden\n */\nexport var MAX_TIME = new Date(1980, 0, 1, 23, 59, 59);\nvar isSet = function (value) { return value !== null && value !== undefined; };\n/**\n * @hidden\n */\nexport var isValidRange = function (min, max) { return (!isSet(min) || !isSet(max) || min <= max); };\n/**\n * @hidden\n */\nexport var setTime = function (origin, candidate) {\n var date = cloneDate(origin);\n date.setHours(candidate.getHours(), candidate.getMinutes(), candidate.getSeconds(), candidate.getMilliseconds());\n return date;\n};\n/**\n * @hidden\n */\nexport var getToday = function () { return getDate(new Date()); };\n/**\n * @hidden\n */\nexport var isInRange = function (candidate, min, max) { return (!candidate || !((min && min > candidate) || (max && max < candidate))); };\n/**\n * @hidden\n */\nexport var isInDateRange = function (candidate, min, max) { return (candidate === null\n || !((min && getDate(min) > getDate(candidate))\n || (max && getDate(max) < getDate(candidate)))); };\n/**\n * @hidden\n */\nexport var isInSelectionRange = function (value, selectionRange) {\n var _a = selectionRange || EMPTY_SELECTIONRANGE, start = _a.start, end = _a.end;\n if (!start || !end) {\n return false;\n }\n return start < value && value < end;\n};\n/**\n * @hidden\n */\nexport var range = function (start, end, step) {\n if (step === void 0) { step = 1; }\n var result = [];\n for (var i = start; i < end; i = i + step) {\n result.push(i);\n }\n return result;\n};\n/**\n * @hidden\n */\nexport var intersects = function (date, min, max) {\n return min.getTime() <= date.getTime() && date.getTime() <= max.getTime();\n};\n/**\n * @hidden\n */\nexport var shiftWeekNames = function (names, offset) { return (names.slice(offset).concat(names.slice(0, offset))); };\n/**\n * @hidden\n */\nexport var dateInRange = function (candidate, min, max) {\n if (!candidate) {\n return candidate;\n }\n if (min && candidate < min) {\n return cloneDate(min);\n }\n if (max && candidate > max) {\n return cloneDate(max);\n }\n return candidate;\n};\n/**\n * @hidden\n */\nexport var domContainerFactory = function (type) { return function (children, classes, styles) {\n if (classes === void 0) { classes = ''; }\n if (styles === void 0) { styles = {}; }\n var container = document.createElement(type);\n container.className = classes;\n Object.keys(styles).map(function (key) { return container.style[key] = styles[key]; });\n if (typeof children === 'string') {\n container.innerHTML = children || '';\n }\n else {\n (children || []).forEach(function (child) { return child && container.appendChild(child); });\n }\n return container;\n}; };\n/**\n * @hidden\n */\nexport function debounce(func, wait, options) {\n if (options === void 0) { options = {}; }\n var lastArgs;\n var lastThis;\n var maxWait = options.maxWait;\n var result;\n var timerId;\n var lastCallTime;\n var root = window;\n var lastInvokeTime = 0;\n var leading = false;\n var maxing = false;\n var trailing = true;\n // Bypass `requestAnimationFrame` by explicitly setting `wait=0`.\n var useRAF = (!wait && wait !== 0 && typeof root.requestAnimationFrame === 'function');\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n wait = +wait || 0;\n function invokeFunc(time) {\n var args = lastArgs;\n var thisArg = lastThis;\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n function startTimer(pendingFunc, tmr) {\n if (useRAF) {\n root.cancelAnimationFrame(timerId);\n return root.requestAnimationFrame(pendingFunc);\n }\n return setTimeout(pendingFunc, tmr);\n }\n function cancelTimer(id) {\n if (useRAF) {\n return root.cancelAnimationFrame(id);\n }\n clearTimeout(id);\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = startTimer(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n var timeWaiting = wait - timeSinceLastCall;\n return maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n function timerExpired() {\n var time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = startTimer(timerExpired, remainingWait(time));\n }\n function trailingEdge(time) {\n timerId = undefined;\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n function cancel() {\n if (timerId !== undefined) {\n cancelTimer(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n function pending() {\n return timerId !== undefined;\n }\n function debounced() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var time = Date.now();\n var isInvoking = shouldInvoke(time);\n lastArgs = args;\n /* @ts-ignore */\n lastThis = this;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = startTimer(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = startTimer(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n debounced.pending = pending;\n return debounced;\n}\n/**\n * @hidden\n */\nexport function throttle(func, wait) {\n return debounce(func, wait, {\n leading: true,\n trailing: true,\n 'maxWait': wait\n });\n}\n","var _a;\n/* tslint:disable:object-literal-sort-keys */\nimport { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury } from '@progress/kendo-date-math';\nimport { Action, EMPTY_SELECTIONRANGE } from '../models';\nimport { getToday, isInRange, isInSelectionRange, range, intersects } from '../../utils';\nvar EMPTY_DATA = [[]];\nvar CELLS_LENGTH = 4;\nvar ROWS_LENGTH = 3;\nvar ACTIONS = (_a = {},\n _a[Action.Left] = function (date) { return addDecades(date, -1); },\n _a[Action.Up] = function (date) { return addDecades(date, -5); },\n _a[Action.Right] = function (date) { return addDecades(date, 1); },\n _a[Action.Down] = function (date) { return addDecades(date, 5); },\n _a[Action.PrevView] = function (date) { return addCenturies(date, -1); },\n _a[Action.NextView] = function (date) { return addCenturies(date, 1); },\n _a[Action.FirstInView] = function (date) { return firstDecadeOfCentury(date); },\n _a[Action.LastInView] = function (date) { return lastDecadeOfCentury(date); },\n _a);\n/**\n * @hidden\n */\nvar CenturyViewService = /** @class */ (function () {\n function CenturyViewService() {\n }\n CenturyViewService.prototype.addToDate = function (min, skip) {\n return addCenturies(min, skip);\n };\n CenturyViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addCenturies(start, i); });\n };\n CenturyViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA;\n }\n var cells = range(0, CELLS_LENGTH);\n var firstDate = firstDecadeOfCentury(viewDate);\n var lastDate = lastDecadeOfCentury(viewDate);\n var today = getToday();\n return range(0, ROWS_LENGTH).map(function (rowOffset) {\n var baseDate = addDecades(firstDate, rowOffset * CELLS_LENGTH);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addDecades(baseDate, cellOffset), min, max);\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n var isSelected = isActiveView && (!Array.isArray(selectedDate)\n ? isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)\n : _this.isSelectedFromArray(cellDate, selectedDate, min, max));\n return intersects(cellDate, firstDate, lastDate) ? ({\n formattedValue: _this.value(cellDate),\n id: \"\".concat(cellUID).concat(cellDate.getTime()),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isSelected,\n isWeekend: false,\n isInRange: isInRange(cellDate, min, max),\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n }) : null;\n });\n });\n };\n CenturyViewService.prototype.isSelectedFromArray = function (candidate, dates, min, max) {\n var _this = this;\n var result = false;\n dates.forEach(function (date) {\n if (isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {\n result = true;\n }\n });\n return result;\n };\n CenturyViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n // TODO: double-check this!\n return firstYearOfDecade(candidate).getFullYear() === firstYearOfDecade(expected).getFullYear();\n };\n CenturyViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 99);\n };\n CenturyViewService.prototype.isInRange = function (candidate, min, max) {\n var year = firstYearOfDecade(candidate).getFullYear();\n var aboveMin = !min || firstYearOfDecade(min).getFullYear() <= year;\n var belowMax = !max || year <= firstYearOfDecade(max).getFullYear();\n return aboveMin && belowMax;\n };\n CenturyViewService.prototype.isInSameView = function (candidate, value) {\n return durationInCenturies(candidate, value) === 0;\n };\n CenturyViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 1000 === 0;\n };\n CenturyViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n CenturyViewService.prototype.cellTitle = function (value) {\n return firstYearOfDecade(value).getFullYear().toString();\n };\n CenturyViewService.prototype.navigationTitle = function (value) {\n return value ? firstDecadeOfCentury(value).getFullYear().toString() : '';\n };\n CenturyViewService.prototype.title = function (value) {\n if (!value) {\n return '';\n }\n return \"\".concat(firstDecadeOfCentury(value).getFullYear(), \" - \").concat(lastDecadeOfCentury(value).getFullYear());\n };\n CenturyViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH;\n };\n CenturyViewService.prototype.skip = function (value, min) {\n return durationInCenturies(min, value);\n };\n CenturyViewService.prototype.total = function (min, max) {\n return durationInCenturies(min, max) + 1;\n };\n CenturyViewService.prototype.value = function (current) {\n return current ? firstYearOfDecade(current).getFullYear().toString() : '';\n };\n CenturyViewService.prototype.viewDate = function (date, max, border) {\n if (border === void 0) { border = 1; }\n var renderTwoViews = durationInCenturies(date, max) < border;\n return renderTwoViews ? addCenturies(date, -1) : date;\n };\n CenturyViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n return CenturyViewService;\n}());\nexport { CenturyViewService };\n","var _a;\nimport { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade } from '@progress/kendo-date-math';\nimport { Action } from '../models/NavigationAction';\nimport { EMPTY_SELECTIONRANGE } from '../models/SelectionRange';\nimport { getToday, isInRange, isInSelectionRange, range, intersects } from '../../utils';\nvar EMPTY_DATA = [[]];\nvar CELLS_LENGTH = 4;\nvar ROWS_LENGTH = 3;\nvar ACTIONS = (_a = {},\n _a[Action.Left] = function (date) { return addYears(date, -1); },\n _a[Action.Up] = function (date) { return addYears(date, -5); },\n _a[Action.Right] = function (date) { return addYears(date, 1); },\n _a[Action.Down] = function (date) { return addYears(date, 5); },\n _a[Action.PrevView] = function (date) { return addDecades(date, -1); },\n _a[Action.NextView] = function (date) { return addDecades(date, 1); },\n _a[Action.FirstInView] = function (date) { return firstYearOfDecade(date); },\n _a[Action.LastInView] = function (date) { return lastYearOfDecade(date); },\n _a);\n/**\n * @hidden\n */\nvar DecadeViewService = /** @class */ (function () {\n function DecadeViewService() {\n }\n DecadeViewService.prototype.addToDate = function (min, skip) {\n return addDecades(min, skip);\n };\n DecadeViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addDecades(start, i); });\n };\n DecadeViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA;\n }\n var cells = range(0, CELLS_LENGTH);\n var firstDate = firstYearOfDecade(viewDate);\n var lastDate = lastYearOfDecade(viewDate);\n var today = getToday();\n return range(0, ROWS_LENGTH).map(function (rowOffset) {\n var baseDate = addYears(firstDate, rowOffset * CELLS_LENGTH);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addYears(baseDate, cellOffset), min, max);\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n var isSelected = isActiveView && (!Array.isArray(selectedDate)\n ? isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)\n : _this.isSelectedFromArray(cellDate, selectedDate, min, max));\n return intersects(cellDate, firstDate, lastDate) ? ({\n formattedValue: _this.value(cellDate),\n id: \"\".concat(cellUID).concat(cellDate.getTime()),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isSelected,\n isWeekend: false,\n isInRange: isInRange(cellDate, min, max),\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n }) : null;\n });\n });\n };\n DecadeViewService.prototype.isSelectedFromArray = function (candidate, dates, min, max) {\n var _this = this;\n var result = false;\n dates.forEach(function (date) {\n if (isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {\n result = true;\n }\n });\n return result;\n };\n DecadeViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return candidate.getFullYear() === expected.getFullYear();\n };\n DecadeViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 9);\n };\n DecadeViewService.prototype.isInRange = function (candidate, min, max) {\n var year = candidate.getFullYear();\n var aboveMin = !min || min.getFullYear() <= year;\n var belowMax = !max || year <= max.getFullYear();\n return aboveMin && belowMax;\n };\n DecadeViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 100 === 0;\n };\n DecadeViewService.prototype.isInSameView = function (candidate, value) {\n return durationInDecades(candidate, value) === 0;\n };\n DecadeViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n DecadeViewService.prototype.cellTitle = function (value) {\n return value.getFullYear().toString();\n };\n DecadeViewService.prototype.navigationTitle = function (value) {\n return value ? firstYearOfDecade(value).getFullYear().toString() : '';\n };\n DecadeViewService.prototype.title = function (value) {\n if (!value) {\n return '';\n }\n return \"\".concat(firstYearOfDecade(value).getFullYear(), \" - \").concat(lastYearOfDecade(value).getFullYear());\n };\n DecadeViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH;\n };\n DecadeViewService.prototype.skip = function (value, min) {\n return durationInDecades(min, value);\n };\n DecadeViewService.prototype.total = function (min, max) {\n return durationInDecades(min, max) + 1;\n };\n DecadeViewService.prototype.value = function (current) {\n return current ? current.getFullYear().toString() : '';\n };\n DecadeViewService.prototype.viewDate = function (date, max, border) {\n if (border === void 0) { border = 1; }\n var renderTwoViews = durationInDecades(date, max) < border;\n return renderTwoViews ? addDecades(date, -1) : date;\n };\n DecadeViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n return DecadeViewService;\n}());\nexport { DecadeViewService };\n","var _a;\nimport { addDays, addWeeks, addMonths, dayOfWeek, durationInMonths, getDate, firstDayOfMonth, lastDayOfMonth } from '@progress/kendo-date-math';\nimport { Action } from '../models/NavigationAction';\nimport { EMPTY_SELECTIONRANGE } from '../models/SelectionRange';\nimport { getToday, isInRange, isInSelectionRange, range } from '../../utils';\nvar EMPTY_DATA = [[]];\nvar CELLS_LENGTH = 7;\nvar ROWS_LENGTH = 6;\nvar SATURDAY = 6;\nvar SUNDAY = 0;\nvar ACTIONS = (_a = {},\n _a[Action.Left] = function (date) { return addDays(date, -1); },\n _a[Action.Up] = function (date) { return addWeeks(date, -1); },\n _a[Action.Right] = function (date) { return addDays(date, 1); },\n _a[Action.Down] = function (date) { return addWeeks(date, 1); },\n _a[Action.PrevView] = function (date) { return addMonths(date, -1); },\n _a[Action.NextView] = function (date) { return addMonths(date, 1); },\n _a[Action.FirstInView] = function (date) { return firstDayOfMonth(date); },\n _a[Action.LastInView] = function (date) { return lastDayOfMonth(date); },\n _a);\n/**\n * @hidden\n */\nvar MonthViewService = /** @class */ (function () {\n function MonthViewService(intl) {\n this.intl = intl;\n }\n MonthViewService.prototype.addToDate = function (min, skip) {\n return addMonths(min, skip);\n };\n MonthViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addMonths(start, i); });\n };\n MonthViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA;\n }\n var firstMonthDate = firstDayOfMonth(viewDate);\n var lastMonthDate = lastDayOfMonth(viewDate);\n var backward = -1;\n var date = dayOfWeek(firstMonthDate, this.intl.firstDay(), backward);\n var cells = range(0, CELLS_LENGTH);\n var today = getToday();\n return range(0, ROWS_LENGTH).map(function (rowOffset) {\n var baseDate = addDays(date, rowOffset * CELLS_LENGTH);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addDays(baseDate, cellOffset), min, max);\n var otherMonth = cellDate < firstMonthDate || cellDate > lastMonthDate;\n if (otherMonth) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n var isSelected = isActiveView && (!Array.isArray(selectedDate)\n ? isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)\n : _this.isSelectedFromArray(cellDate, selectedDate, min, max));\n var cell = {\n formattedValue: _this.value(cellDate),\n id: \"\".concat(cellUID).concat(cellDate.getTime()),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isSelected,\n isInRange: isInRange(cellDate, min, max),\n isWeekend: _this.isWeekend(cellDate),\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstMonthDate),\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastMonthDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n };\n return cell;\n });\n });\n };\n MonthViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return getDate(candidate).getTime() === getDate(expected).getTime();\n };\n MonthViewService.prototype.isSelectedFromArray = function (candidate, dates, min, max) {\n var _this = this;\n var result = false;\n dates.forEach(function (date) {\n if (isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {\n result = true;\n }\n });\n return result;\n };\n MonthViewService.prototype.isInArray = function (date, dates) {\n return !!dates.length && firstDayOfMonth(dates[0]) <= date && date <= lastDayOfMonth(dates[dates.length - 1]);\n };\n MonthViewService.prototype.isInRange = function (candidate, min, max) {\n var value = getDate(candidate);\n var aboveMin = !min || getDate(min) <= value;\n var belowMax = !max || value <= getDate(max);\n return aboveMin && belowMax;\n };\n MonthViewService.prototype.isInSameView = function (candidate, value) {\n return durationInMonths(candidate, value) === 0;\n };\n MonthViewService.prototype.isRangeStart = function (value) {\n return !value.getMonth();\n };\n MonthViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n MonthViewService.prototype.cellTitle = function (value) {\n return this.intl.formatDate(value, 'D');\n };\n MonthViewService.prototype.navigationTitle = function (value) {\n if (!value) {\n return '';\n }\n return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];\n };\n MonthViewService.prototype.title = function (current) {\n return \"\".concat(this.wideMonthNames()[current.getMonth()], \" \").concat(current.getFullYear());\n };\n MonthViewService.prototype.rowLength = function (prependCell) {\n return CELLS_LENGTH + (prependCell ? 1 : 0);\n };\n MonthViewService.prototype.skip = function (value, min) {\n return durationInMonths(min, value);\n };\n MonthViewService.prototype.total = function (min, max) {\n return durationInMonths(min, max) + 1;\n };\n MonthViewService.prototype.value = function (current) {\n return current ? current.getDate().toString() : '';\n };\n MonthViewService.prototype.viewDate = function (date, max, border) {\n if (border === void 0) { border = 1; }\n var renderTwoViews = durationInMonths(date, max) < border;\n return renderTwoViews ? addMonths(date, -1) : date;\n };\n MonthViewService.prototype.isWeekend = function (date) {\n var day = date.getDay();\n return day === SATURDAY || day === SUNDAY;\n };\n MonthViewService.prototype.abbrMonthNames = function () {\n return this.intl.dateFormatNames({ nameType: 'abbreviated', type: 'months' });\n };\n MonthViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return getDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return getDate(max);\n }\n return cellDate;\n };\n MonthViewService.prototype.wideMonthNames = function () {\n return this.intl.dateFormatNames({ nameType: 'wide', type: 'months', standAlone: true });\n };\n return MonthViewService;\n}());\nexport { MonthViewService };\n","var _a;\nimport { addMonths, addYears, createDate, durationInYears, firstMonthOfYear, lastMonthOfYear } from '@progress/kendo-date-math';\nimport { Action } from '../models/NavigationAction';\nimport { getToday, isInRange, isInSelectionRange, range } from '../../utils';\nimport { EMPTY_SELECTIONRANGE } from '../models/SelectionRange';\nimport { cloneDate } from '@progress/kendo-date-math';\nvar EMPTY_DATA = [[]];\nvar CELLS_LENGTH = 4;\nvar ROWS_LENGTH = 3;\nvar upStep = function (month) {\n if (month > 4) {\n return -5;\n }\n if (month < 2) {\n return -2;\n }\n return -7;\n};\nvar downStep = function (month) {\n if (month < 7) {\n return 5;\n }\n if (month < 10) {\n return 7;\n }\n return 2;\n};\nvar ACTIONS = (_a = {},\n _a[Action.Left] = function (date) { return addMonths(date, -1); },\n _a[Action.Up] = function (date) { return addMonths(date, upStep(date.getMonth())); },\n _a[Action.Right] = function (date) { return addMonths(date, 1); },\n _a[Action.Down] = function (date) { return addMonths(date, downStep(date.getMonth())); },\n _a[Action.PrevView] = function (date) { return addYears(date, -1); },\n _a[Action.NextView] = function (date) { return addYears(date, 1); },\n _a[Action.FirstInView] = function (date) { return firstMonthOfYear(date); },\n _a[Action.LastInView] = function (date) { return lastMonthOfYear(date); },\n _a);\n/**\n * @hidden\n */\nvar YearViewService = /** @class */ (function () {\n function YearViewService(intl) {\n this._intl = intl;\n }\n YearViewService.prototype.addToDate = function (min, skip) {\n return addYears(min, skip);\n };\n YearViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addYears(start, i); });\n };\n YearViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA;\n }\n var months = this.abbrMonthNames();\n var firstDate = firstMonthOfYear(viewDate);\n var lastDate = lastMonthOfYear(viewDate);\n var currentYear = firstDate.getFullYear();\n var cells = range(0, CELLS_LENGTH);\n var today = getToday();\n return range(0, ROWS_LENGTH).map(function (rowOffset) {\n var baseDate = addMonths(firstDate, rowOffset * CELLS_LENGTH);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addMonths(baseDate, cellOffset), min, max);\n var changedYear = currentYear < cellDate.getFullYear();\n if (changedYear) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n var isSelected = isActiveView && (!Array.isArray(selectedDate)\n ? isInRange(selectedDate, min, max) && _this.isEqual(cellDate, selectedDate)\n : _this.isSelectedFromArray(cellDate, selectedDate, min, max));\n return {\n formattedValue: months[cellDate.getMonth()],\n id: \"\".concat(cellUID).concat(cellDate.getTime()),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isSelected,\n isInRange: isInRange(cellDate, min, max),\n isWeekend: false,\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n };\n });\n });\n };\n YearViewService.prototype.isSelectedFromArray = function (candidate, dates, min, max) {\n var _this = this;\n var result = false;\n dates.forEach(function (date) {\n if (isInRange(candidate, min, max) && _this.isEqual(candidate, date)) {\n result = true;\n }\n });\n return result;\n };\n YearViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return candidate.getFullYear() === expected.getFullYear() &&\n candidate.getMonth() === expected.getMonth();\n };\n YearViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= dates[dates.length - 1].getFullYear();\n };\n YearViewService.prototype.isInRange = function (candidate, min, max) {\n var candidateValue = createDate(candidate.getFullYear(), candidate.getMonth(), 1);\n var aboveMin = !min || createDate(min.getFullYear(), min.getMonth(), 1) <= candidateValue;\n var belowMax = !max || candidateValue <= createDate(max.getFullYear(), max.getMonth(), 1);\n return aboveMin && belowMax;\n };\n YearViewService.prototype.isInSameView = function (candidate, value) {\n return durationInYears(candidate, value) === 0;\n };\n YearViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 10 === 0;\n };\n YearViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n YearViewService.prototype.cellTitle = function (value) {\n return \"\".concat(value.getFullYear(), \" \").concat(this.value(value));\n };\n YearViewService.prototype.navigationTitle = function (value) {\n return this.title(value);\n };\n YearViewService.prototype.title = function (current) {\n return current ? current.getFullYear().toString() : '';\n };\n YearViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH;\n };\n YearViewService.prototype.skip = function (value, min) {\n return durationInYears(min, value);\n };\n YearViewService.prototype.total = function (min, max) {\n return durationInYears(min, max) + 1;\n };\n YearViewService.prototype.value = function (current) {\n return current ? this.abbrMonthNames()[current.getMonth()] : '';\n };\n YearViewService.prototype.viewDate = function (date, max, border) {\n if (border === void 0) { border = 1; }\n var renderTwoViews = durationInYears(date, max) < border;\n return renderTwoViews ? addYears(date, -1) : date;\n };\n YearViewService.prototype.abbrMonthNames = function () {\n return this._intl.dateFormatNames({ nameType: 'abbreviated', type: 'months' });\n };\n YearViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n return YearViewService;\n}());\nexport { YearViewService };\n","var _a;\nimport { CenturyViewService } from './CenturyViewService';\nimport { DecadeViewService } from './DecadeViewService';\nimport { MonthViewService } from './MonthViewService';\nimport { YearViewService } from './YearViewService';\nimport { CalendarViewEnum } from '../models/CalendarViewEnum';\nvar services = (_a = {},\n _a[CalendarViewEnum.month] = MonthViewService,\n _a[CalendarViewEnum.year] = YearViewService,\n _a[CalendarViewEnum.decade] = DecadeViewService,\n _a[CalendarViewEnum.century] = CenturyViewService,\n _a);\nvar viewOffset = function (view, offset) {\n var candidate = CalendarViewEnum[CalendarViewEnum[view + offset]];\n return candidate !== undefined ? candidate : view;\n};\n/**\n * @hidden\n */\nvar BusViewService = /** @class */ (function () {\n function BusViewService(onViewChanged) {\n this.bottom = CalendarViewEnum.month;\n this.top = CalendarViewEnum.century;\n this.onViewChanged = onViewChanged;\n }\n BusViewService.prototype.configure = function (bottom, top) {\n this.bottom = bottom;\n this.top = top;\n };\n BusViewService.prototype.service = function (view, intl) {\n return new services[\"\".concat(view)](intl);\n };\n BusViewService.prototype.moveDown = function (view, event) {\n this.move(view, -1, event);\n };\n BusViewService.prototype.moveUp = function (view, event) {\n this.move(view, 1, event);\n };\n BusViewService.prototype.moveToBottom = function (activeView) {\n if (activeView === this.bottom) {\n return;\n }\n this.onViewChanged({ view: this.bottom });\n };\n BusViewService.prototype.canMoveDown = function (view) {\n return this.bottom < view;\n };\n BusViewService.prototype.canMoveUp = function (view) {\n return view < this.top;\n };\n BusViewService.prototype.clamp = function (view) {\n if (view < this.bottom) {\n return this.bottom;\n }\n if (view > this.top) {\n return this.top;\n }\n return view;\n };\n BusViewService.prototype.move = function (view, offset, event) {\n var candidate = this.clamp(viewOffset(view, offset));\n if (candidate === view) {\n return;\n }\n this.onViewChanged({ view: candidate }, event);\n };\n return BusViewService;\n}());\nexport { BusViewService };\n","import { CalendarViewEnum } from '../models/CalendarViewEnum';\nimport { domContainerFactory as containerFactory } from '../../utils';\nimport { canUseDOM } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar DOMService = /** @class */ (function () {\n function DOMService() {\n // heights\n this.calendarHeight = 0;\n this.headerHeight = 0;\n this.monthViewHeight = 0;\n this.yearViewHeight = 0;\n this.decadeViewHeight = 0;\n this.centuryViewHeight = 0;\n this.navigationItemHeight = 0;\n this.scrollableContentHeight = 0;\n this.scrollableYearContentHeight = 0;\n // widths\n this.calendarWidth = 0;\n this.monthViewWidth = 0;\n this.yearViewWidth = 0;\n this.decadeViewWidth = 0;\n this.centuryViewWidth = 0;\n this.scrollableContentWidth = 0;\n this.didCalculate = false;\n this.hostContainer = null;\n }\n DOMService.prototype.ensureHeights = function () {\n if (this.calendarHeight !== undefined) {\n return;\n }\n this.calculateHeights();\n };\n DOMService.prototype.calculateHeights = function (container) {\n var _this = this;\n if (!canUseDOM) {\n return;\n }\n var div = containerFactory('div');\n var ul = containerFactory('ul');\n var li = containerFactory('li');\n var td = containerFactory('td');\n var th = containerFactory('th');\n var tr = containerFactory('tr');\n var tbody = containerFactory('tbody');\n var thead = containerFactory('thead');\n var table = containerFactory('table');\n var monthHeader = function () { return (div(\"\\n \\n March 2017\\n \\n \\n \\n \", 'k-calendar-header k-hstack')); };\n var monthWeekHeader = function () { return (table([\n thead([\n tr([th('MO', 'k-calendar-th')], 'k-calendar-tr')\n ], 'k-calendar-thead')\n ], 'k-calendar-table k-calendar-weekdays')); };\n var repeat = function (count, mapper) { return new Array(count).fill('1').map(mapper); };\n var content = function (rows, cells) {\n if (cells === void 0) { cells = 1; }\n return (table([\n tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td(\"\".concat(c, \"\"), 'k-calendar-td'); }), 'k-calendar-tr'); })), 'k-calendar-tbody')\n ], 'k-calendar-table'));\n };\n var scrollable = function (children) { return div(children, 'k-content k-scrollable'); };\n var view = function (contentElement, className, renderWeekHeader) { return (div(renderWeekHeader\n ? [\n monthHeader(),\n monthWeekHeader(),\n scrollable([contentElement, contentElement])\n ]\n : [\n monthHeader(),\n scrollable([contentElement, contentElement])\n ], className, { left: '-10000px', position: 'absolute' })); };\n var navigationList = (function () {\n var navElement;\n return function () {\n if (!canUseDOM) {\n return null;\n }\n if (!navElement) {\n navElement = div([scrollable([ul([li('FEB')])])], 'k-calendar-navigation', { left: '0px', position: 'absolute' });\n }\n return navElement;\n };\n })();\n var viewFactory = function (_a, className, renderWeekHeader) {\n var cells = _a.cells, rows = _a.rows;\n var viewElement;\n return function () {\n if (!canUseDOM) {\n return null;\n }\n if (!viewElement) {\n viewElement = view(content(rows, cells), className, renderWeekHeader);\n }\n return viewElement;\n };\n };\n var getScrollable = function (element) { return element.querySelector('.k-scrollable'); };\n var horizontal = function (element) {\n var scrollableElement = getScrollable(element);\n scrollableElement.className = \"\".concat(scrollableElement.className, \" k-scrollable-horizontal\");\n return element;\n };\n var monthView = viewFactory({ cells: 7, rows: 6 }, 'k-calendar-view k-calendar-monthview k-vstack', true);\n var yearView = viewFactory({ cells: 5, rows: 3 }, 'k-calendar-view k-calendar-yearview', false);\n var decadeView = viewFactory({ cells: 5, rows: 2 }, 'k-calendar-view k-calendar-decadeview', false);\n var horzMonthView = function () { return horizontal(monthView()); };\n var horzYearView = function () { return horizontal(yearView()); };\n var horzDecadeView = function () { return horizontal(decadeView()); };\n var height = function (element) { return (parseFloat(window.getComputedStyle(element).height) || element.offsetHeight); };\n var width = function (element) {\n var styles = window.getComputedStyle(element);\n var computed = parseFloat(styles.width)\n + parseFloat(styles.paddingLeft)\n + parseFloat(styles.paddingRight);\n return computed || element.offsetWidth;\n };\n var getBody = function (element) { return element.querySelector('tbody'); };\n this.didCalculate = true;\n if (container) {\n this.hostContainer = container;\n }\n this.batch(monthView(), function (contentElement) {\n var viewElement = getBody(contentElement);\n _this.calendarHeight = height(contentElement);\n _this.monthViewHeight = height(viewElement);\n _this.headerHeight = height(viewElement.children[0]);\n _this.scrollableContentHeight = height(getScrollable(contentElement));\n });\n this.batch(horzMonthView(), function (contentElement) {\n var viewElement = getBody(contentElement);\n _this.calendarWidth = width(contentElement);\n _this.monthViewWidth = width(viewElement);\n _this.scrollableContentWidth = width(getScrollable(contentElement));\n });\n this.batch(yearView(), function (contentElement) {\n _this.yearViewHeight = height(getBody(contentElement));\n _this.scrollableYearContentHeight = height(getScrollable(contentElement));\n });\n this.batch(horzYearView(), function (contentElement) {\n _this.yearViewWidth = width(getBody(contentElement));\n });\n this.batch(decadeView(), function (contentElement) {\n _this.decadeViewHeight = height(getBody(contentElement));\n _this.centuryViewHeight = _this.decadeViewHeight;\n });\n this.batch(horzDecadeView(), function (contentElement) {\n _this.decadeViewWidth = width(getBody(contentElement));\n _this.centuryViewWidth = _this.decadeViewWidth;\n });\n this.batch(navigationList(), function (contentElement) {\n _this.navigationItemHeight = height(contentElement.querySelector('li'));\n });\n };\n DOMService.prototype.viewHeight = function (viewType) {\n return this.viewDimension(viewType, 'height');\n };\n DOMService.prototype.viewWidth = function (viewType) {\n return this.viewDimension(viewType, 'width');\n };\n DOMService.prototype.viewDimension = function (viewType, dimension) {\n var viewProp = dimension === 'height' ? 'ViewHeight' : 'ViewWidth';\n switch (viewType) {\n case CalendarViewEnum.month:\n return this[\"month\".concat(viewProp)];\n case CalendarViewEnum.year:\n return this[\"year\".concat(viewProp)];\n case CalendarViewEnum.decade:\n return this[\"decade\".concat(viewProp)];\n case CalendarViewEnum.century:\n return this[\"century\".concat(viewProp)];\n default:\n return 1;\n }\n };\n DOMService.prototype.batch = function (contentElement, action) {\n var hostContainer = this.hostContainer || document.body;\n var appendedContent = hostContainer.appendChild(contentElement);\n action(appendedContent);\n hostContainer.removeChild(appendedContent);\n };\n return DOMService;\n}());\nexport { DOMService };\n","import { Action } from '../models/NavigationAction';\nvar KEY_TO_ACTION = {\n '33': Action.PrevView,\n '34': Action.NextView,\n '35': Action.LastInView,\n '36': Action.FirstInView,\n '37': Action.Left,\n '38': Action.Up,\n '39': Action.Right,\n '40': Action.Down,\n 'meta+38': Action.UpperView,\n 'meta+40': Action.LowerView\n};\n/**\n * @hidden\n */\nvar NavigationService = /** @class */ (function () {\n function NavigationService(bus) {\n this.bus = bus;\n }\n NavigationService.prototype.action = function (event) {\n var action = \"\".concat(event.ctrlKey || event.metaKey ? 'meta+' : '').concat(event.keyCode);\n return KEY_TO_ACTION[action];\n };\n NavigationService.prototype.move = function (value, action, activeView, service, event) {\n if (!service) {\n return value;\n }\n if (action === Action.UpperView && this.bus.canMoveUp(activeView)) {\n this.bus.moveUp(activeView, event);\n return value;\n }\n if (action === Action.LowerView && this.bus.canMoveDown(activeView)) {\n this.bus.moveDown(activeView, event);\n return value;\n }\n return service.move(value, action);\n };\n return NavigationService;\n}());\nexport { NavigationService };\n","var divideByMagnitude = function (magnitude) { return function (x) { return Math.floor(x / magnitude); }; };\nvar powerByMagnitude = function (magnitude) { return function (x) { return x * magnitude; }; };\n/**\n * @hidden\n */\nvar ScrollSyncService = /** @class */ (function () {\n function ScrollSyncService(dom) {\n this.dom = dom;\n this.divideByMagnitude = null;\n this.powerByMagnitude = null;\n this.navigator = null;\n this.view = null;\n this.monthScrolled = false;\n this.navScrolled = false;\n }\n ScrollSyncService.prototype.configure = function (activeView) {\n var magnitude = Math.max(this.dom.viewHeight(activeView) / this.dom.navigationItemHeight, 1);\n this.divideByMagnitude = divideByMagnitude(magnitude);\n this.powerByMagnitude = powerByMagnitude(magnitude);\n };\n ScrollSyncService.prototype.sync = function (navigator, view, e) {\n if (!navigator || !view) {\n return;\n }\n this.navigator = navigator;\n this.view = view;\n if (e.target === this.navigator.element) {\n if (this.monthScrolled) {\n this.monthScrolled = false;\n return;\n }\n this.navScrolled = true;\n this.scrollSiblingOf(this.navigator.element);\n }\n if (e.target === this.view.element) {\n if (this.navScrolled) {\n this.navScrolled = false;\n return;\n }\n this.monthScrolled = true;\n this.scrollSiblingOf(this.view.element);\n }\n };\n ScrollSyncService.prototype.scrollSiblingOf = function (scrolledElement) {\n var component = this.siblingComponent(scrolledElement);\n var scrollTop = this.calculateScroll(component, scrolledElement.scrollTop);\n component.scrollTo(scrollTop);\n };\n ScrollSyncService.prototype.siblingComponent = function (scrollableElement) {\n return this.navigator.element === scrollableElement ? this.view : this.navigator;\n };\n ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {\n var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;\n return modifier ? modifier(scrollTop) : 0;\n };\n return ScrollSyncService;\n}());\nexport { ScrollSyncService };\n","import { shiftWeekNames } from '../../utils';\n/**\n * @hidden\n */\nvar WeekNamesService = /** @class */ (function () {\n function WeekNamesService(intl) {\n this.intl = intl;\n }\n WeekNamesService.prototype.getWeekNames = function (includeWeekNumber) {\n if (includeWeekNumber === void 0) { includeWeekNumber = false; }\n var weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());\n return includeWeekNumber ? [''].concat(weekNames) : weekNames;\n };\n return WeekNamesService;\n}());\nexport { WeekNamesService };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { weekInYear, cloneDate } from '@progress/kendo-date-math';\nimport { registerForIntl, provideIntlService } from '@progress/kendo-react-intl';\nimport { CalendarCell } from './CalendarCell';\nimport { CalendarWeekCell } from './CalendarWeekCell';\nimport { CalendarViewEnum } from '../models';\nimport { setTime, getToday } from '../../utils';\nimport { WeekNamesService } from '../services';\n// In case we decide to render content for the next month in the empty cells,\n// add k-other-month class to all cells and k-weekend for weekend cells.\n// tslint:disable-next-line jsx-use-translation-function\nvar emptyCell = function (idx) { return (React.createElement(\"td\", { key: idx, className: 'k-calendar-td' }, \"\\u00A0\")); };\n/**\n * @hidden\n */\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.intl = null;\n _this.weekService = null;\n _this.buildWeekNumber = function (row, idx) {\n var firstDayOfWeek = _this.firstDate(row);\n if (!firstDayOfWeek) {\n return emptyCell(\"week-cell-\".concat(idx));\n }\n var firstDate = _this.firstDate(row);\n var weekCellValue = _this.getWeekNumber(firstDate);\n var uniqueID = \"kendo-react-calendar-week-cell-\".concat(weekCellValue);\n var cellProps = {\n className: 'k-alt',\n value: weekCellValue,\n firstDate: firstDate\n };\n return _this.props.weekCell\n ? React.createElement(_this.props.weekCell, __assign({}, cellProps, { key: uniqueID }), weekCellValue)\n : React.createElement(CalendarWeekCell, __assign({}, cellProps, { key: uniqueID }), weekCellValue);\n };\n _this.buildRow = function (row) {\n return row.map(function (cell, idx) {\n if (!cell) {\n return emptyCell(idx);\n }\n var aria = { 'aria-selected': cell.isSelected };\n var uniqueID = \"kendo-react-calendar-cell-\".concat(cell.value.getTime());\n var cellProps = __assign(__assign(__assign({}, aria), cell), { isDisabled: !cell.isInRange, view: _this.props.activeView, onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave });\n return _this.props.cell\n ? (React.createElement(_this.props.cell, __assign({}, cellProps, { key: uniqueID }), cell.formattedValue))\n : (React.createElement(CalendarCell, __assign({}, cellProps, { key: uniqueID }), cell.formattedValue));\n });\n };\n _this.firstDate = function (row) {\n var cell = _this.firstWeekDateContext(row);\n return cell ? cell.value : null;\n };\n _this.firstWeekDateContext = function (rowCtx) {\n if (!_this.weekNumber) {\n return null;\n }\n var idx = 0;\n var ctx = rowCtx[idx];\n while (!ctx && idx < rowCtx.length) {\n ctx = rowCtx[++idx];\n }\n return ctx;\n };\n _this.handleClick = function (value, event) {\n var onChange = _this.props.onChange;\n if (onChange && event) {\n var args = {\n value: cloneDate(value),\n target: _this,\n nativeEvent: event && event.nativeEvent,\n syntheticEvent: event\n };\n onChange.call(undefined, args);\n }\n };\n _this.handleMouseEnter = function (value) {\n var onCellEnter = _this.props.onCellEnter;\n if (onCellEnter) {\n onCellEnter.call(undefined, cloneDate(value));\n }\n };\n _this.handleMouseLeave = function (value) {\n var onCellLeave = _this.props.onCellLeave;\n if (onCellLeave) {\n onCellLeave.call(undefined, cloneDate(value));\n }\n };\n return _this;\n }\n Object.defineProperty(View.prototype, \"min\", {\n get: function () {\n return this.props.min;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"max\", {\n get: function () {\n return this.props.max;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"isHorizontal\", {\n get: function () {\n return this.props.direction === 'horizontal';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"isMonthView\", {\n get: function () {\n return this.props.activeView === CalendarViewEnum.month;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"weekNumber\", {\n get: function () {\n return Boolean(this.props.showWeekNumbers && this.props.activeView === CalendarViewEnum.month);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"selectedDate\", {\n get: function () {\n return this.props.selectedDate !== undefined ? this.props.selectedDate : View.defaultProps.selectedDate;\n },\n enumerable: false,\n configurable: true\n });\n View.prototype.render = function () {\n var _this = this;\n this.intl = provideIntlService(this);\n this.weekService = new WeekNamesService(this.intl);\n var weekNames = this.weekService.getWeekNames(this.weekNumber);\n var colSpan = this.props.service.rowLength(this.weekNumber);\n var title = this.props.service.title(this.props.viewDate);\n var time = getToday();\n var viewDate = setTime(this.props.viewDate, time);\n var data = this.props.service.data({\n cellUID: this.props.cellUID,\n min: this.min,\n max: this.max,\n focusedDate: this.props.focusedDate,\n isActiveView: !this.props.bus.canMoveDown(this.props.activeView),\n selectedDate: this.selectedDate,\n selectionRange: this.props.selectionRange,\n viewDate: viewDate\n });\n return (React.createElement(React.Fragment, null,\n (this.isMonthView && this.isHorizontal) && (React.createElement(\"thead\", { role: \"rowgroup\", className: \"k-calendar-thead\" },\n React.createElement(\"tr\", { role: \"row\", className: \"k-calendar-tr\" }, weekNames.map(function (name, idx) { return (React.createElement(\"th\", { key: idx, className: \"k-calendar-th\" }, name)); })))),\n React.createElement(\"tbody\", { role: \"rowgroup\", className: \"k-calendar-tbody\" },\n !this.isHorizontal && (React.createElement(\"tr\", { role: \"presentation\", className: \"k-calendar-tr\" },\n React.createElement(\"th\", { scope: \"col\", colSpan: colSpan, className: \"k-calendar-caption\" }, title))),\n data.map(function (row, idx) {\n return (React.createElement(\"tr\", { role: \"row\", className: \"k-calendar-tr\", key: idx },\n _this.weekNumber && _this.buildWeekNumber(row, idx),\n _this.buildRow(row)));\n }))));\n };\n View.prototype.getWeekNumber = function (date) {\n if (!this.weekNumber || !this.intl) {\n return null;\n }\n return weekInYear(date, this.intl.firstDay());\n };\n View.propTypes = {\n activeRangeEnd: PropTypes.oneOf(['start', 'end', null]),\n activeView: PropTypes.number.isRequired,\n cellUID: PropTypes.string.isRequired,\n direction: PropTypes.oneOf(['horizontal', 'vertical']),\n focusedDate: PropTypes.instanceOf(Date).isRequired,\n max: PropTypes.instanceOf(Date).isRequired,\n min: PropTypes.instanceOf(Date).isRequired,\n onChange: PropTypes.func,\n selectedDate: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.arrayOf(PropTypes.instanceOf(Date))]),\n showWeekNumbers: PropTypes.bool,\n viewDate: PropTypes.instanceOf(Date).isRequired\n };\n View.defaultProps = {\n direction: 'vertical',\n selectedDate: getToday(),\n showWeekNumbers: false\n };\n return View;\n}(React.Component));\nexport { View };\nregisterForIntl(View);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { Button } from '@progress/kendo-react-buttons';\nimport * as React from 'react';\n/**\n * The `CalendarHeaderTitle` component is internally used for rendering the title of the current calendar view. Also used as a custom `headerTitle` for the [Calendar]({% slug api_dateinputs_calendarprops %}#toc-headertitle) and the [MultiViewCalendar]({% slug api_dateinputs_multiviewcalendarprops %}#toc-headertitle) components.\n *\n * * [Customizing the title for the current Calendar view]({% slug custom_rendering_calendar %}#toc-cells-inside-the-view)\n * * [Customizing the title for the current MultiViewCalendar view]({% slug custom_rendering_multiviewcalendar %}#toc-cells-inside-the-view)\n */\nvar CalendarHeaderTitle = /** @class */ (function (_super) {\n __extends(CalendarHeaderTitle, _super);\n function CalendarHeaderTitle() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @return\n * Returns a `` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.\n */\n CalendarHeaderTitle.prototype.render = function () {\n var _a = this.props, view = _a.view, props = __rest(_a, [\"view\"]);\n return (React.createElement(Button, __assign({ type: \"button\", fillMode: \"flat\" }, props), this.props.children));\n };\n return CalendarHeaderTitle;\n}(React.PureComponent));\nexport { CalendarHeaderTitle };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { registerForLocalization } from '@progress/kendo-react-intl';\nimport { classNames } from '@progress/kendo-react-common';\nimport { CalendarHeaderTitle } from './CalendarHeaderTitle';\nimport { MIN_DATE, MAX_DATE } from '../../utils';\n/**\n * @hidden\n */\nvar Header = /** @class */ (function (_super) {\n __extends(Header, _super);\n function Header() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.getTitle = function () {\n if (!_this.props.currentDate) {\n return '';\n }\n var take = _this.rangeLength - 1;\n var title = _this.props.service.title(_this.props.currentDate);\n var nextDate = _this.props.service.addToDate(_this.props.currentDate, take);\n if (take < 1 || !_this.props.service.isInRange(nextDate, _this.min, _this.max)) {\n return title;\n }\n return \"\".concat(title, \" - \").concat(_this.props.service.title(nextDate));\n };\n _this.handleTitleClick = function (event) {\n if (!_this.canMoveUp) {\n return;\n }\n _this.props.bus.moveUp(_this.props.activeView, event);\n };\n return _this;\n }\n Object.defineProperty(Header.prototype, \"min\", {\n get: function () {\n return this.props.min !== undefined\n ? this.props.min\n : Header.defaultProps.min;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Header.prototype, \"max\", {\n get: function () {\n return this.props.max !== undefined\n ? this.props.max\n : Header.defaultProps.max;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Header.prototype, \"rangeLength\", {\n get: function () {\n return this.props.rangeLength !== undefined ? this.props.rangeLength : Header.defaultProps.rangeLength;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Header.prototype, \"canMoveUp\", {\n get: function () {\n return this.props.bus.canMoveUp(this.props.activeView);\n },\n enumerable: false,\n configurable: true\n });\n Header.prototype.render = function () {\n var title = this.getTitle();\n var titleClassNames = classNames('k-calendar-title');\n var headerTitleProps = {\n children: title,\n value: title,\n view: this.props.activeView,\n className: titleClassNames,\n onClick: this.handleTitleClick,\n disabled: !this.canMoveUp\n };\n var headerTitle = this.props.headerTitle\n ? React.createElement(this.props.headerTitle, __assign({}, headerTitleProps), title)\n : React.createElement(CalendarHeaderTitle, __assign({}, headerTitleProps), title);\n return (React.createElement(\"div\", { className: classNames('k-calendar-header', {\n 'k-vstack': this.props.verticalView,\n 'k-hstack': !this.props.verticalView\n }) },\n headerTitle,\n React.createElement(\"span\", { className: \"k-spacer\" }),\n React.createElement(\"span\", { className: \"k-calendar-nav k-hstack\" }, this.props.commands)));\n };\n Header.propTypes = {\n activeView: PropTypes.number.isRequired,\n currentDate: PropTypes.instanceOf(Date).isRequired,\n max: PropTypes.instanceOf(Date).isRequired,\n min: PropTypes.instanceOf(Date).isRequired,\n rangeLength: PropTypes.number\n };\n Header.defaultProps = {\n rangeLength: 1,\n min: MIN_DATE,\n max: MAX_DATE\n };\n return Header;\n}(React.Component));\nexport { Header };\nregisterForLocalization(Header);\n","var _a;\n/**\n * @hidden\n */\nexport var prevView = 'multiviewcalendar.prevView';\n/**\n * @hidden\n */\nexport var nextView = 'multiviewcalendar.nextView';\n/**\n * @hidden\n */\nexport var increaseValue = 'dateinput.increment';\n/**\n * @hidden\n */\nexport var decreaseValue = 'dateinput.decrement';\n/**\n * @hidden\n */\nexport var today = 'calendar.today';\n/**\n * @hidden\n */\nexport var toggleCalendar = 'datepicker.toggleCalendar';\n/**\n * @hidden\n */\nexport var swapStartEnd = 'daterangepicker.swapStartEnd';\n/**\n * @hidden\n */\nexport var start = 'daterangepicker.start';\n/**\n * @hidden\n */\nexport var end = 'daterangepicker.end';\n/**\n * @hidden\n */\nexport var separator = 'daterangepicker.separator';\n/**\n * @hidden\n */\nexport var toggleDateTimeSelector = 'datetimepicker.toggleDateTimeSelector';\n/**\n * @hidden\n */\nexport var now = 'timepicker.now';\n/**\n * @hidden\n */\nexport var selectNow = 'timepicker.selectNow';\n/**\n * @hidden\n */\nexport var timePickerCancel = 'timepicker.cancel';\n/**\n * @hidden\n */\nexport var timePickerSet = 'timepicker.set';\n/**\n * @hidden\n */\nexport var toggleTimeSelector = 'timepicker.toggleTimeSelector';\n/**\n * @hidden\n */\nexport var toggleClock = 'timepicker.toggleClock';\n/**\n * @hidden\n */\nexport var date = 'datetimepicker.date';\n/**\n * @hidden\n */\nexport var time = 'datetimepicker.time';\n/**\n * @hidden\n */\nexport var dateTimePickerCancel = 'datetimepicker.cancel';\n/**\n * @hidden\n */\nexport var dateTimePickerSet = 'datetimepicker.set';\n/**\n * @hidden\n */\nexport var dateRangePickerCancel = 'daterangepicker.cancel';\n/**\n * @hidden\n */\nexport var dateRangePickerSet = 'daterangepicker.set';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[today] = 'TODAY',\n _a[now] = 'NOW',\n _a[timePickerSet] = 'Set',\n _a[timePickerCancel] = 'Cancel',\n _a[date] = 'Date',\n _a[time] = 'Time',\n _a[dateTimePickerCancel] = 'Cancel',\n _a[dateTimePickerSet] = 'Set',\n _a[dateRangePickerCancel] = 'Cancel',\n _a[dateRangePickerSet] = 'Set',\n _a[start] = 'Start',\n _a[end] = 'End',\n _a[separator] = ' ',\n _a[selectNow] = 'Select Now',\n _a[toggleTimeSelector] = 'Toggle TimeSelector',\n _a[toggleClock] = 'Toggle Clock',\n _a[increaseValue] = 'Increase value',\n _a[decreaseValue] = 'Decrease value',\n _a[toggleCalendar] = 'Toggle calendar',\n _a[prevView] = 'Navigate to previous view',\n _a[nextView] = 'Navigate to next view',\n _a[swapStartEnd] = 'Swap start and end values',\n _a[toggleDateTimeSelector] = 'Toggle date-time selector',\n _a);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { provideLocalizationService, registerForLocalization } from '@progress/kendo-react-intl';\nimport { classNames } from '@progress/kendo-react-common';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { getDate } from '@progress/kendo-date-math';\nimport { messages, today } from '../../messages';\nimport { dateInRange, getToday, isInRange } from '../../utils';\nimport { MIN_DATE, MAX_DATE } from '../../utils';\nvar TodayCommand = /** @class */ (function (_super) {\n __extends(TodayCommand, _super);\n function TodayCommand() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.localization = null;\n _this.handleClick = function (syntheticEvent) {\n if (!_this.todayIsInRange) {\n return;\n }\n if (_this.props.onClick) {\n var event_1 = {\n syntheticEvent: syntheticEvent,\n nativeEvent: syntheticEvent.nativeEvent,\n value: dateInRange(getToday(), _this.min, _this.max),\n target: _this,\n isTodayClick: true\n };\n _this.props.onClick.call(undefined, event_1);\n }\n };\n return _this;\n }\n Object.defineProperty(TodayCommand.prototype, \"min\", {\n get: function () {\n return this.props.min !== undefined\n ? this.props.min\n : TodayCommand.defaultProps.min;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TodayCommand.prototype, \"max\", {\n get: function () {\n return this.props.max !== undefined\n ? this.props.max\n : TodayCommand.defaultProps.max;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TodayCommand.prototype, \"todayIsInRange\", {\n get: function () {\n return isInRange(getToday(), getDate(this.min), getDate(this.max));\n },\n enumerable: false,\n configurable: true\n });\n TodayCommand.prototype.render = function () {\n this.localization = provideLocalizationService(this);\n var todayMessage = this.localization.toLanguageString(today, messages[today]);\n var todayClassNames = classNames('k-calendar-nav-today', {\n 'k-disabled': this.props.disabled\n });\n return (React.createElement(Button, { className: todayClassNames, onClick: this.handleClick, tabIndex: this.props.tabIndex, fillMode: 'flat' }, todayMessage));\n };\n TodayCommand.propTypes = {\n max: PropTypes.instanceOf(Date).isRequired,\n min: PropTypes.instanceOf(Date).isRequired,\n onClick: PropTypes.func,\n disabled: PropTypes.bool\n };\n TodayCommand.defaultProps = {\n min: MIN_DATE,\n max: MAX_DATE\n };\n return TodayCommand;\n}(React.Component));\nexport { TodayCommand };\nregisterForLocalization(TodayCommand);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames } from '@progress/kendo-react-common';\nimport { cloneDate, getDate, isEqualDate } from '@progress/kendo-date-math';\nimport { registerForIntl, provideIntlService } from '@progress/kendo-react-intl';\nimport { Virtualization } from '../../virtualization/Virtualization';\nimport { View } from './View';\nimport { Header } from './Header';\nimport { dateInRange, getToday, isInRange, shiftWeekNames } from '../../utils';\nimport { CalendarViewEnum } from '../models';\nimport { TodayCommand } from './TodayCommand';\nvar VIEWS_COUNT = 5;\n/**\n * @hidden\n */\nvar ViewList = /** @class */ (function (_super) {\n __extends(ViewList, _super);\n function ViewList(props) {\n var _this = _super.call(this, props) || this;\n _this.virtualization = null;\n _this.calendarView = null;\n _this.table = null;\n _this.intl = null;\n _this.bottomOffset = 0;\n _this.viewOffset = 0;\n _this.viewHeight = 0;\n _this._element = null;\n _this.isActive = false;\n _this.animateToIndex = true;\n _this.shouldScroll = false;\n _this.focusActiveDate = function () {\n if (!_this._element) {\n return;\n }\n var focusedCell = _this._element.querySelector('td.k-focus');\n var nextActiveCell = _this._element.querySelector('.k-state-pending-focus');\n if (focusedCell && focusedCell[0]) {\n focusedCell[0].classList.remove('k-focus');\n }\n if (nextActiveCell) {\n nextActiveCell.classList.add('k-focus');\n }\n _this.isActive = true;\n };\n _this.blurActiveDate = function () {\n if (!_this._element) {\n return;\n }\n var focusedCell = _this._element.querySelector('td.k-focus');\n if (focusedCell) {\n focusedCell.classList.remove('k-focus');\n }\n _this.isActive = false;\n };\n _this.handleVirtualizationMount = function (virtualization) {\n _this.virtualization = virtualization;\n if (_this.virtualization && _this.table) {\n _this.table.style.transform = \"translateY(\".concat(_this.viewOffset, \"px)\");\n var viewDate = dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);\n var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);\n _this.virtualization.scrollToIndex(indexToScroll);\n }\n };\n _this.buildMonthView = function (cols, weekNames) {\n return (React.createElement(\"table\", { key: \"calendar-view-list-weekdays\", className: \"k-calendar-table k-calendar-weekdays\", role: \"grid\", tabIndex: _this.props.tabIndex },\n React.createElement(\"colgroup\", null, cols.map(function (_, idx) { return (React.createElement(\"col\", { key: idx })); })),\n React.createElement(\"thead\", { className: \"k-calendar-thead\" },\n React.createElement(\"tr\", { className: \"k-calendar-tr\" }, weekNames.map(function (name, idx) { return (React.createElement(\"th\", { key: idx, className: \"k-calendar-th\" }, name)); })))));\n };\n _this.buildDates = function (cols, dates) {\n var cellUID = _this.props.cellUID;\n return (React.createElement(\"table\", { className: \"k-calendar-table\", ref: function (table) { return _this.table = table; }, role: \"grid\", tabIndex: _this.props.tabIndex, \"aria-activedescendant\": cellUID + _this.props.focusedDate.getTime() },\n React.createElement(\"colgroup\", null, cols.map(function (_, idx) { return (React.createElement(\"col\", { key: idx })); })),\n dates.map(function (date) { return (React.createElement(View, { ref: function (el) { if (!_this.calendarView) {\n _this.calendarView = el;\n } }, key: date.getTime(), activeView: _this.props.activeView, viewDate: date, min: _this.props.min, max: _this.props.max, cellUID: cellUID, focusedDate: _this.props.focusedDate, cell: _this.props.cell, selectedDate: _this.props.value, showWeekNumbers: _this.weekNumber, onChange: _this.handleDateChange, bus: _this.props.bus, service: _this.props.service, weekCell: _this.props.weekCell })); })));\n };\n _this.calculateHeights = function () {\n if (!_this.props.dom) {\n return;\n }\n var scrollableHeight = _this.props.activeView === CalendarViewEnum.month ?\n _this.props.dom.scrollableContentHeight :\n _this.props.dom.scrollableYearContentHeight;\n _this.bottomOffset = scrollableHeight - _this.props.dom.viewHeight(_this.props.activeView);\n _this.viewOffset = -1 * _this.props.dom.headerHeight;\n _this.viewHeight = _this.props.dom.viewHeight(_this.props.activeView) || 1;\n };\n _this.getTake = function (skip, total) {\n return Math.min(total - skip, _this.take);\n };\n _this.handleScrollAction = function (_a) {\n var index = _a.index, scrollAction = _a.scrollAction, pageAction = _a.pageAction;\n var skip = pageAction ? pageAction.skip : _this.state.skip;\n if (_this.state.index !== index || _this.state.skip !== skip) {\n _this.setState({ index: index, skip: skip });\n }\n if (_this.table && scrollAction) {\n var translate = \"translateY(\".concat(scrollAction.offset, \"px)\");\n _this.table.style.transform = translate;\n }\n };\n _this.handleTodayClick = function (event) {\n _this.shouldScroll = true;\n _this.handleDateChange.call(undefined, event, true);\n };\n _this.handleDateChange = function (event, isTodayClick) {\n if (isTodayClick === void 0) { isTodayClick = false; }\n var onChange = _this.props.onChange;\n if (onChange) {\n var args = {\n syntheticEvent: event.syntheticEvent,\n nativeEvent: event.nativeEvent,\n value: cloneDate(event.value),\n target: _this,\n isTodayClick: isTodayClick\n };\n onChange.call(undefined, args);\n }\n };\n _this.lastView = _this.props.activeView;\n _this.lastFocus = _this.props.focusedDate;\n _this.state = {\n skip: _this.props.service.skip(_this.props.focusedDate, _this.props.min),\n index: _this.props.service.skip(_this.props.focusedDate, _this.props.min)\n };\n return _this;\n }\n Object.defineProperty(ViewList.prototype, \"element\", {\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewList.prototype, \"weekNames\", {\n get: function () {\n this.intl = provideIntlService(this);\n var weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());\n return this.weekNumber ? [''].concat(weekNames) : weekNames;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewList.prototype, \"weekNumber\", {\n get: function () {\n return Boolean(this.props.showWeekNumbers && this.props.activeView === CalendarViewEnum.month);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewList.prototype, \"take\", {\n get: function () {\n return this.props.take !== undefined ? this.props.take : ViewList.defaultProps.take;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewList.prototype, \"animate\", {\n get: function () {\n return Boolean(this.props.smoothScroll && this.animateToIndex);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewList.prototype, \"todayIsInRange\", {\n get: function () {\n return isInRange(getToday(), getDate(this.props.min), getDate(this.props.max));\n },\n enumerable: false,\n configurable: true\n });\n ViewList.prototype.componentDidUpdate = function (_prevProps, _prevState) {\n this.shouldScroll = false;\n if (this.indexToScroll !== undefined && this.virtualization) {\n this.virtualization[this.animate ? 'animateToIndex' : 'scrollToIndex'](this.indexToScroll);\n }\n if (this.isActive) {\n this.focusActiveDate();\n }\n this.lastView = this.props.activeView;\n // this.lastFocus = this.props.focusedDate;\n this.indexToScroll = undefined;\n };\n ViewList.prototype.render = function () {\n var _this = this;\n this.calculateHeights();\n var didViewChange = this.lastView !== this.props.activeView;\n var focusedDate = dateInRange(this.props.focusedDate, this.props.min, this.props.max);\n var skip = !didViewChange ? this.state.skip : this.props.service.skip(focusedDate, this.props.min);\n var total = this.props.service.total(this.props.min, this.props.max);\n var take = this.getTake(skip, total);\n var viewDate = this.props.service.addToDate(this.props.min, skip);\n var activeDate = this.props.service.addToDate(this.props.min, this.state.index);\n var cols = new Array(this.props.service.rowLength(this.weekNumber)).fill('');\n var didViewChanged = this.props.activeView !== this.lastView;\n this.animateToIndex = !didViewChanged;\n if (didViewChanged\n || !isEqualDate(this.lastFocus, focusedDate)\n || this.shouldScroll\n || (!this.props.shouldScroll || this.props.shouldScroll())) {\n this.indexToScroll = this.props.service.skip(focusedDate, this.props.min);\n }\n this.lastFocus = focusedDate;\n var rootClassNames = classNames('k-calendar-view k-vstack', {\n 'k-calendar-monthview': this.props.activeView === CalendarViewEnum.month,\n 'k-calendar-yearview': this.props.activeView === CalendarViewEnum.year,\n 'k-calendar-decadeview': this.props.activeView === CalendarViewEnum.decade,\n 'k-calendar-centuryview': this.props.activeView === CalendarViewEnum.century\n });\n var dates = this.buildDates(cols, this.props.service.datesList(viewDate, take));\n var viewListBody = (React.createElement(React.Fragment, null,\n React.createElement(Header, { key: \"calendar-view-list-header\", currentDate: activeDate, min: this.props.min, max: this.props.max, activeView: this.props.activeView, bus: this.props.bus, service: this.props.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,\n React.createElement(TodayCommand, { min: this.props.min, max: this.props.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange, tabIndex: this.props.tabIndex }))) }),\n this.props.activeView === CalendarViewEnum.month && this.buildMonthView(cols, this.weekNames),\n React.createElement(Virtualization, { key: \"calendar-view-list-content\", skip: skip, take: this.take, total: total, itemHeight: this.viewHeight, topOffset: this.viewOffset, bottomOffset: this.bottomOffset, scrollOffsetSize: this.viewOffset, maxScrollDifference: this.viewHeight, onScroll: this.props.onScroll, onScrollAction: this.handleScrollAction, onMount: this.handleVirtualizationMount, children: dates, tabIndex: this.props.tabIndex })));\n return (React.createElement(\"div\", { ref: function (el) { _this._element = el; }, className: rootClassNames }, this.props.dom.didCalculate ? viewListBody : null));\n };\n ViewList.propTypes = {\n activeView: PropTypes.number.isRequired,\n bottomOffset: PropTypes.number,\n cellUID: PropTypes.string.isRequired,\n focusedDate: PropTypes.instanceOf(Date).isRequired,\n max: PropTypes.instanceOf(Date).isRequired,\n min: PropTypes.instanceOf(Date).isRequired,\n onChange: PropTypes.func,\n showWeekNumbers: PropTypes.bool,\n smoothScroll: PropTypes.bool,\n take: PropTypes.number,\n value: PropTypes.instanceOf(Date),\n viewHeight: PropTypes.number,\n viewOffset: PropTypes.number,\n tabIndex: PropTypes.number\n };\n ViewList.defaultProps = {\n take: VIEWS_COUNT,\n showWeekNumbers: false,\n smoothScroll: true\n };\n return ViewList;\n}(React.Component));\nexport { ViewList };\nregisterForIntl(ViewList);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * The `CalendarNavigationItem` component is internally used for rendering the items in the side navigation of the Calendar. Also used as a custom navigation item for the [Calendar]({% slug api_dateinputs_calendarprops %}#toc-navigationitem) ([see example]({% slug custom_rendering_calendar %}#toc-items-in-the-side-navigation)).\n */\nvar CalendarNavigationItem = /** @class */ (function (_super) {\n __extends(CalendarNavigationItem, _super);\n function CalendarNavigationItem() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleClick = function (event) {\n var _a = _this.props, onClick = _a.onClick, value = _a.value;\n if (onClick) {\n onClick.call(undefined, value, event);\n }\n };\n return _this;\n }\n /**\n * @return\n * Returns a `
  • ` element with a `` inside. The text inside represents the [`value`]({% slug api_dateinputs_calendarnavigationitemprops %}#toc-value) of the `navigationItem`.\n */\n CalendarNavigationItem.prototype.render = function () {\n var _a = this.props, isRangeStart = _a.isRangeStart, value = _a.value, text = _a.text, other = __rest(_a, [\"isRangeStart\", \"value\", \"text\"]);\n return (React.createElement(\"li\", __assign({}, other, { onClick: this.handleClick }),\n React.createElement(\"span\", { className: classNames({ 'k-calendar-navigation-marker': isRangeStart }) }, this.props.children)));\n };\n return CalendarNavigationItem;\n}(React.Component));\nexport { CalendarNavigationItem };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { cloneDate, isEqual } from '@progress/kendo-date-math';\nimport { CalendarNavigationItem } from './CalendarNavigationItem';\nimport { dateInRange } from '../../utils';\nimport { Virtualization } from '../../virtualization/Virtualization';\nvar ITEMS_COUNT = 30;\n/**\n * @hidden\n */\nvar Navigation = /** @class */ (function (_super) {\n __extends(Navigation, _super);\n function Navigation(props) {\n var _this = _super.call(this, props) || this;\n _this.virtualization = null;\n _this.list = null;\n _this.itemHeight = 0;\n _this.topOffset = 0;\n _this.maxViewHeight = 0;\n _this.bottomOffset = 0;\n _this.handleVirtualizationMount = function (virtualization) {\n _this.virtualization = virtualization;\n if (_this.virtualization && _this.list) {\n _this.list.style.transform = \"translateY(\".concat(_this.topOffset, \"px)\");\n var viewDate = dateInRange(_this.props.focusedDate, _this.props.min, _this.props.max);\n var indexToScroll = _this.props.service.skip(viewDate, _this.props.min);\n _this.virtualization.scrollToIndex(indexToScroll);\n }\n };\n _this.buildNavigationItem = function (date) {\n var text = _this.props.service.navigationTitle(date);\n var isRangeStart = _this.props.service.isRangeStart(date);\n var uniqueID = \"kendo-react-calendar-nav-item-\".concat(date.getTime());\n var navigationItemProps = {\n text: text,\n value: date,\n isRangeStart: isRangeStart,\n view: _this.props.activeView,\n onClick: _this.handleDateChange\n };\n return _this.props.navigationItem\n ? (React.createElement(_this.props.navigationItem, __assign({}, navigationItemProps, { key: uniqueID }), text))\n : (React.createElement(CalendarNavigationItem, __assign({}, navigationItemProps, { key: uniqueID }), text));\n };\n _this.calculateHeights = function () {\n var calendarHeight = _this.props.dom.calendarHeight;\n _this.itemHeight = _this.props.dom.navigationItemHeight || 1;\n _this.maxViewHeight = _this.props.dom.monthViewHeight;\n _this.topOffset = (calendarHeight - _this.itemHeight) / 2;\n _this.bottomOffset = calendarHeight - _this.itemHeight;\n };\n _this.handleDateChange = function (value, event) {\n var onChange = _this.props.onChange;\n if (onChange && event) {\n var args = {\n value: cloneDate(value),\n target: _this,\n nativeEvent: event && event.nativeEvent,\n syntheticEvent: event\n };\n onChange.call(undefined, args);\n }\n };\n _this.handleScrollAction = function (_a) {\n var scrollAction = _a.scrollAction, pageAction = _a.pageAction;\n var skip = pageAction ? pageAction.skip : _this.state.skip;\n if (_this.state.skip !== skip) {\n _this.setState({ skip: skip });\n }\n if (_this.list && scrollAction) {\n var translate = \"translateY(\".concat(scrollAction.offset, \"px)\");\n _this.list.style.transform = translate;\n }\n };\n _this.lastView = _this.props.activeView;\n _this.lastFocus = _this.props.focusedDate;\n var skip = _this.props.service.skip(_this.props.focusedDate, _this.props.min);\n var total = _this.props.service.total(_this.props.min, _this.props.max);\n _this.state = {\n skip: (skip - _this.getTake(skip, total) > 0) ? skip : 0\n };\n return _this;\n }\n Object.defineProperty(Navigation.prototype, \"take\", {\n get: function () {\n return this.props.take !== undefined\n ? this.props.take\n : Navigation.defaultProps.take;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n Navigation.prototype.componentDidUpdate = function (_prevProps, _prevState) {\n if (this.indexToScroll !== undefined && this.virtualization) {\n this.virtualization.scrollToIndex(this.indexToScroll);\n }\n this.lastView = this.props.activeView;\n this.lastFocus = this.props.focusedDate;\n this.indexToScroll = undefined;\n };\n Navigation.prototype.render = function () {\n var _this = this;\n this.calculateHeights();\n var didViewChange = this.lastView !== this.props.activeView;\n var focusedDate = dateInRange(this.props.focusedDate, this.props.min, this.props.max);\n var skip = !didViewChange ? this.state.skip : this.props.service.skip(focusedDate, this.props.min);\n var total = this.props.service.total(this.props.min, this.props.max);\n var take = this.getTake(skip, total);\n var viewDate = this.props.service.addToDate(this.props.min, skip);\n var dates = this.props.service.datesList(viewDate, take);\n if (this.props.activeView !== this.lastView\n || !isEqual(focusedDate, this.lastFocus)) {\n this.indexToScroll = this.props.service.skip(focusedDate, this.props.min);\n }\n var navigationBody = (React.createElement(Virtualization, { skip: skip, take: this.take, total: total, itemHeight: this.itemHeight, topOffset: this.topOffset, bottomOffset: this.bottomOffset, onScroll: this.props.onScroll, maxScrollDifference: this.maxViewHeight, onScrollAction: this.handleScrollAction, onMount: this.handleVirtualizationMount, tabIndex: this.props.tabIndex },\n React.createElement(\"ul\", { ref: function (el) { _this.list = el; }, className: \"k-reset\" }, dates.map(function (date) { return (_this.buildNavigationItem(date)); }))));\n return (React.createElement(\"div\", { className: \"k-calendar-navigation\" },\n React.createElement(\"span\", { className: \"k-calendar-navigation-highlight\" }),\n this.props.dom.didCalculate ? navigationBody : null));\n };\n Navigation.prototype.getTake = function (skip, total) {\n return Math.min(total - skip, this.take);\n };\n Navigation.propTypes = {\n activeView: PropTypes.number.isRequired,\n focusedDate: PropTypes.instanceOf(Date).isRequired,\n max: PropTypes.instanceOf(Date).isRequired,\n min: PropTypes.instanceOf(Date).isRequired,\n onChange: PropTypes.func,\n take: PropTypes.number,\n tabIndex: PropTypes.number\n };\n Navigation.defaultProps = {\n take: ITEMS_COUNT\n };\n return Navigation;\n}(React.Component));\nexport { Navigation };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { classNames, guid, Keys, validatePackage, withPropsContext, createPropsContext, setScrollbarWidth } from '@progress/kendo-react-common';\nimport { cloneDate, getDate, isEqualDate } from '@progress/kendo-date-math';\nimport { provideIntlService, registerForIntl } from '@progress/kendo-react-intl';\nimport { packageMetadata } from '../../package-metadata';\nimport { ViewList } from './ViewList';\nimport { Navigation } from './Navigation';\nimport { CalendarViewEnum } from '../models';\nimport { getToday, dateInRange, isInRange, viewInRange, MIN_DATE, MAX_DATE } from '../../utils';\nimport { BusViewService, DOMService, ScrollSyncService, NavigationService } from '../services';\nvar virtualizationProp = function (x) { return x ? x.virtualization : null; };\nvar calculateValue = function (min, max, stateValue, propValue) {\n if (min === void 0) { min = CalendarWithoutContext.defaultProps.min; }\n if (max === void 0) { max = CalendarWithoutContext.defaultProps.max; }\n return propValue !== undefined\n ? propValue !== null && isInRange(getDate(propValue), min, max)\n ? propValue\n : null\n : stateValue !== null && isInRange(getDate(stateValue), min, max)\n ? stateValue\n : null;\n};\n/** @hidden */\nvar CalendarWithoutContext = /** @class */ (function (_super) {\n __extends(CalendarWithoutContext, _super);\n function CalendarWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n _this.scrollSyncService = null;\n _this.focusedDate = null;\n _this.cellUID = guid();\n _this.id = guid();\n _this.Navigation = null;\n _this.calendarViewList = null;\n _this._element = null;\n _this.intl = null;\n _this.service = null;\n _this.isActive = false;\n _this.didNavigationChange = false;\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this._element) {\n _this._element.focus();\n }\n };\n _this.shouldScroll = function () { return _this.didNavigationChange; };\n _this.handleScroll = function (event) {\n if (!_this.scrollSyncService) {\n return;\n }\n _this.scrollSyncService.sync(virtualizationProp(_this.Navigation), virtualizationProp(_this.calendarViewList), event);\n };\n _this.handleNavigationChange = function (event) {\n if (_this.props.disabled) {\n return;\n }\n _this.didNavigationChange = true;\n var focusedDate = cloneDate(event.value);\n _this.setState({ focusedDate: focusedDate });\n };\n _this.handleViewChange = function (_a) {\n var view = _a.view;\n if (_this.scrollSyncService) {\n _this.scrollSyncService.configure(view);\n }\n _this.setState({ activeView: view });\n };\n _this.handleDateChange = function (event) {\n var value = cloneDate(event.value);\n var focusedDate = cloneDate(event.value);\n var canNavigateDown = _this.bus.canMoveDown(_this.state.activeView);\n if (_this.props.disabled) {\n return;\n }\n if (canNavigateDown) {\n if (event.isTodayClick) {\n _this.bus.moveToBottom(_this.state.activeView);\n }\n else {\n _this.bus.moveDown(_this.state.activeView, event.syntheticEvent);\n _this.setState({ focusedDate: focusedDate });\n return;\n }\n }\n _this.setState({ value: value, focusedDate: focusedDate });\n _this.valueDuringOnChange = value;\n var onChange = _this.props.onChange;\n if (onChange) {\n var args = {\n syntheticEvent: event.syntheticEvent,\n nativeEvent: event.nativeEvent,\n value: value,\n target: _this\n };\n onChange.call(undefined, args);\n }\n _this.valueDuringOnChange = undefined;\n };\n _this.handleFocus = function (event) {\n _this.isActive = true;\n if (!_this.calendarViewList) {\n return;\n }\n _this.calendarViewList.focusActiveDate();\n var onFocus = _this.props.onFocus;\n if (onFocus) {\n onFocus.call(undefined, event);\n }\n };\n _this.handleBlur = function (event) {\n _this.isActive = false;\n if (!_this.calendarViewList) {\n return;\n }\n _this.calendarViewList.blurActiveDate();\n var onBlur = _this.props.onBlur;\n if (onBlur) {\n onBlur.call(undefined, event);\n }\n };\n _this.handleKeyDown = function (event) {\n var keyCode = event.keyCode;\n if (!_this.focusedDate || !_this.service) {\n return;\n }\n if (keyCode === Keys.enter) {\n if (_this.value !== null\n && isEqualDate(_this.focusedDate, _this.value)) {\n var viewDate = dateInRange(_this.focusedDate, _this.min, _this.max);\n virtualizationProp(_this.calendarViewList).scrollToIndex(_this.service.skip(viewDate, _this.min));\n }\n var args = {\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n value: _this.focusedDate,\n target: _this\n };\n _this.handleDateChange(args);\n }\n else {\n var candidate = dateInRange(_this.navigation.move(_this.focusedDate, _this.navigation.action(event), _this.state.activeView, _this.service, event), _this.min, _this.max);\n if (isEqualDate(_this.focusedDate, candidate)) {\n return;\n }\n _this.setState({ focusedDate: candidate });\n }\n event.preventDefault();\n };\n _this.handleMouseDown = function (event) {\n event.preventDefault();\n };\n _this.handleClick = function (_) {\n if (_this._element) {\n _this._element.focus({ preventScroll: true });\n }\n };\n validatePackage(packageMetadata);\n var value = calculateValue(_this.min, _this.max, _this.props.defaultValue || CalendarWithoutContext.defaultProps.defaultValue, _this.props.value);\n _this.state = {\n value: value,\n activeView: viewInRange(CalendarViewEnum[props.defaultActiveView], _this.bottomView, _this.topView),\n focusedDate: dateInRange(props.focusedDate\n || value\n || getToday(), _this.min, _this.max)\n };\n _this.dom = new DOMService();\n _this.bus = new BusViewService(_this.handleViewChange);\n _this.navigation = new NavigationService(_this.bus);\n _this.oldValue = value;\n return _this;\n }\n Object.defineProperty(CalendarWithoutContext.prototype, \"element\", {\n /**\n * Gets the wrapping element of the Calendar.\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CalendarWithoutContext.prototype, \"value\", {\n /**\n * Gets the value of the Calendar.\n */\n get: function () {\n return this.valueDuringOnChange !== undefined\n ? this.valueDuringOnChange\n : this.props.value !== undefined\n ? this.props.value\n : this.state.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CalendarWithoutContext.prototype, \"min\", {\n get: function () {\n return getDate(this.props.min !== undefined\n ? this.props.min\n : CalendarWithoutContext.defaultProps.min);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CalendarWithoutContext.prototype, \"max\", {\n get: function () {\n return getDate(this.props.max !== undefined\n ? this.props.max\n : CalendarWithoutContext.defaultProps.max);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CalendarWithoutContext.prototype, \"bottomView\", {\n get: function () {\n return CalendarViewEnum[this.props.bottomView !== undefined\n ? this.props.bottomView\n : CalendarWithoutContext.defaultProps.bottomView];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CalendarWithoutContext.prototype, \"topView\", {\n get: function () {\n return CalendarViewEnum[this.props.topView !== undefined\n ? this.props.topView\n : CalendarWithoutContext.defaultProps.topView];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n CalendarWithoutContext.prototype.componentDidMount = function () {\n var _this = this;\n // Async calculation of height to avoid animation cancellation\n Promise.resolve().then(function () {\n setScrollbarWidth();\n if (!_this._element) {\n return;\n }\n _this.dom.calculateHeights(_this._element);\n _this.scrollSyncService = new ScrollSyncService(_this.dom);\n _this.scrollSyncService.configure(_this.state.activeView);\n _this.forceUpdate();\n });\n };\n /**\n * @hidden\n */\n CalendarWithoutContext.prototype.componentDidUpdate = function (_, prevState) {\n setScrollbarWidth();\n if (prevState.activeView !== this.state.activeView && this.scrollSyncService) {\n this.scrollSyncService.configure(this.state.activeView);\n }\n if (this.calendarViewList) {\n (this.isActive ? this.calendarViewList.focusActiveDate : this.calendarViewList.blurActiveDate)();\n }\n this.didNavigationChange = false;\n this.oldValue = this.value;\n };\n /**\n * @hidden\n */\n CalendarWithoutContext.prototype.render = function () {\n var _this = this;\n if (this.props._ref) {\n this.props._ref(this);\n }\n var didValueChange = this.value !== null && this.oldValue !== null\n ? !isEqualDate(this.value, this.oldValue)\n : this.value !== this.oldValue;\n var activeView = viewInRange(this.state.activeView, CalendarViewEnum[this.props.bottomView !== undefined\n ? this.props.bottomView\n : CalendarWithoutContext.defaultProps.bottomView], CalendarViewEnum[this.props.topView !== undefined\n ? this.props.topView\n : CalendarWithoutContext.defaultProps.topView]);\n var value = calculateValue(this.min, this.max, this.value, this.value);\n var sanitizedValue = value ? getDate(value) : null;\n this.focusedDate = getDate(dateInRange(didValueChange && value !== null\n ? value\n : this.state.focusedDate, this.min, this.max));\n this.intl = provideIntlService(this);\n this.bus.configure(this.bottomView, this.topView);\n this.service = this.bus.service(activeView, this.intl);\n var rootClassNames = classNames('k-widget k-calendar k-calendar-infinite', {\n 'k-disabled': this.props.disabled,\n 'k-week-number': this.props.weekNumber,\n 'k-calendar-lg': this.props.mobileMode\n }, this.props.className);\n var calendarBody = [this.props.navigation && (React.createElement(Navigation, { key: 0, ref: function (el) { _this.Navigation = el; }, activeView: this.state.activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, onScroll: this.handleScroll, onChange: this.handleNavigationChange, service: this.service, dom: this.dom, navigationItem: this.props.navigationItem, tabIndex: this.props.tabIndex })), (React.createElement(ViewList, { key: 1, ref: function (el) { _this.calendarViewList = el; }, activeView: this.state.activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, shouldScroll: this.shouldScroll, onScroll: this.handleScroll, service: this.service, cell: this.props.cell, weekCell: this.props.weekCell, dom: this.dom, smoothScroll: this.props.smoothScroll, showWeekNumbers: this.props.weekNumber, onChange: this.handleDateChange, value: sanitizedValue, cellUID: this.cellUID, headerTitle: this.props.headerTitle, tabIndex: this.props.tabIndex }))];\n return (React.createElement(\"div\", { ref: function (el) { _this._element = el; }, className: rootClassNames, id: this.props.id || this.id, \"aria-labelledby\": this.props.ariaLabelledBy, \"aria-describedby\": this.props.ariaDescribedBy, \"aria-disabled\": this.props.disabled, tabIndex: !this.props.disabled ? this.props.tabIndex || 0 : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, onMouseDown: this.handleMouseDown, onClick: this.handleClick }, calendarBody));\n };\n /**\n * @hidden\n */\n CalendarWithoutContext.displayName = 'Calendar';\n /**\n * @hidden\n */\n CalendarWithoutContext.propTypes = {\n className: PropTypes.string,\n defaultActiveView: PropTypes.oneOf(['month', 'year', 'decade', 'century']),\n defaultValue: PropTypes.instanceOf(Date),\n disabled: PropTypes.bool,\n focusedDate: PropTypes.instanceOf(Date),\n id: PropTypes.string,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n max: PropTypes.instanceOf(Date),\n min: PropTypes.instanceOf(Date),\n navigation: PropTypes.bool,\n smoothScroll: PropTypes.bool,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n tabIndex: PropTypes.number,\n value: PropTypes.instanceOf(Date),\n weekNumber: PropTypes.bool,\n topView: function (props, propName, componentName) {\n var prop = props[propName];\n var bottomView = props.bottomView;\n if (prop && bottomView && CalendarViewEnum[prop] < CalendarViewEnum[bottomView]) {\n return new Error(\"Invalid prop + \".concat(propName, \" suplied to \").concat(componentName, \".\\n \").concat(propName, \" can not be smaller than bottomView.\\n \"));\n }\n return null;\n },\n bottomView: function (props, propName, componentName) {\n var prop = props[propName];\n var topView = props.topView;\n if (prop && topView && CalendarViewEnum[prop] > CalendarViewEnum[topView]) {\n return new Error(\"Invalid prop + \".concat(propName, \" suplied to \").concat(componentName, \".\\n \").concat(propName, \" can not be bigger than topView.\\n \"));\n }\n return null;\n }\n };\n /**\n * @hidden\n */\n CalendarWithoutContext.defaultProps = {\n disabled: false,\n min: MIN_DATE,\n max: MAX_DATE,\n navigation: true,\n defaultActiveView: 'month',\n defaultValue: null,\n smoothScroll: true,\n topView: 'century',\n bottomView: 'month'\n };\n return CalendarWithoutContext;\n}(React.Component));\nexport { CalendarWithoutContext };\n/**\n * Represents the PropsContext of the `Calendar` component.\n * Used for global configuration of all `Calendar` instances.\n *\n * For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.\n */\nexport var CalendarPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the KendoReact Calendar Component.\n *\n * Accepts properties of type [CalendarProps]({% slug api_dateinputs_calendarprops %}).\n * Obtaining the `ref` returns an object of type [CalendarHandle]({% slug api_dateinputs_calendarhandle %}).\n */\nexport var Calendar = withPropsContext(CalendarPropsContext, CalendarWithoutContext);\nCalendar.displayName = 'KendoReactCalendar';\nregisterForIntl(CalendarWithoutContext);\n","/**\n * @hidden\n */\nvar Mask = /** @class */ (function () {\n function Mask() {\n this.symbols = '';\n this.partMap = [];\n }\n return Mask;\n}());\nexport { Mask };\n","/**\n * @hidden\n */\nexport var defaultFormat = 'd';\n/**\n * @hidden\n */\nexport var defaultFormatPlaceholder = 'wide';\n/**\n * @hidden\n */\nexport var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };\n/**\n * @hidden\n */\nexport var approximateStringMatching = function (oldTextOrigin, oldFormat, newTextOrigin, selectionStart) {\n /*\n Remove the right part of the cursor.\n oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length);\n */\n var oldTextSeparator = oldTextOrigin[selectionStart + oldTextOrigin.length - newTextOrigin.length];\n var oldText = oldTextOrigin.substring(0, selectionStart + oldTextOrigin.length - newTextOrigin.length);\n var newText = newTextOrigin.substring(0, selectionStart);\n var diff = [];\n /* Handle the typing of a single character over the same selection. */\n if (oldText === newText && selectionStart > 0) {\n diff.push([oldFormat[selectionStart - 1], newText[selectionStart - 1]]);\n return diff;\n }\n if (oldText.indexOf(newText) === 0 &&\n (newText.length === 0 || oldFormat[newText.length - 1] !== oldFormat[newText.length])) {\n /* Handle Delete/Backspace. */\n var deletedSymbol = '';\n /*\n The whole text is replaced by the same character.\n A nasty patch is required to keep the selection in the first segment.\n */\n if (newText.length === 1) {\n diff.push([oldFormat[0], newText[0]]);\n }\n for (var i = newText.length; i < oldText.length; i++) {\n if (oldFormat[i] !== deletedSymbol && oldFormat[i] !== '_') {\n deletedSymbol = oldFormat[i];\n diff.push([deletedSymbol, '']);\n }\n }\n return diff;\n }\n /*\n Handle the insertion of the text (the new text is longer than the previous one).\n Handle the typing over a literal as well.\n */\n if (newText.indexOf(oldText) === 0 || oldFormat[selectionStart - 1] === '_') {\n var symbol = oldFormat[0];\n for (var i = Math.max(0, oldText.length - 1); i < oldFormat.length; i++) {\n if (oldFormat[i] !== '_') {\n symbol = oldFormat[i];\n break;\n }\n }\n return [[symbol, newText[selectionStart - 1]]];\n }\n /* Handle the entering of a space or a separator for navigating to the next item. */\n if (newText[newText.length - 1] === ' ' || newText[newText.length - 1] === oldTextSeparator) {\n return [[oldFormat[selectionStart - 1], '_']];\n }\n /* Handle typing over a correctly selected part. */\n return [[oldFormat[selectionStart - 1], newText[selectionStart - 1]]];\n};\n/**\n * @hidden\n */\nexport var dateSymbolMap = function (map, part) { map[part.pattern[0]] = part.type; return map; };\n/**\n * @hidden\n */\nexport var isInRange = function (candidate, min, max) { return (candidate === null || !((min && min > candidate) || (max && max < candidate))); };\n/**\n * @hidden\n */\nexport var invalidClasses = ['k-invalid'];\n/** @hidden */\nexport var wrapperClasses = ['k-widget', 'k-dateinput'];\n","import { addMonths, cloneDate, createDate, isEqual, getDate, lastDayOfMonth } from '@progress/kendo-date-math';\nimport { Mask } from './mask';\nimport { dateSymbolMap } from './../utils';\n/**\n * @hidden\n */\nvar KendoDate = /** @class */ (function () {\n function KendoDate(intlProvider, formatPlaceholder, format) {\n this.year = true;\n this.month = true;\n this.date = true;\n this.hours = true;\n this.minutes = true;\n this.seconds = true;\n this.milliseconds = true;\n this.leadingZero = null;\n this.typedMonthPart = '';\n this.knownParts = 'adHhmMsEy';\n this.symbols = {\n 'E': 'E',\n 'H': 'H',\n 'M': 'M',\n 'a': 'a',\n 'd': 'd',\n 'h': 'h',\n 'm': 'm',\n 's': 's',\n 'y': 'y'\n };\n this._value = getDate(new Date());\n this.intlProvider = intlProvider;\n this.formatPlaceholder = formatPlaceholder;\n this.format = format;\n this.monthNames = this.allFormatedMonths();\n }\n Object.defineProperty(KendoDate.prototype, \"intl\", {\n get: function () {\n return this.intlProvider();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KendoDate.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n KendoDate.prototype.setValue = function (value) {\n if (!value) {\n this._value = getDate(new Date());\n this.modifyExisting(false);\n }\n else if (!isEqual(value, this._value)) {\n this._value = cloneDate(value);\n this.modifyExisting(true);\n }\n };\n KendoDate.prototype.hasValue = function () {\n var _this = this;\n var pred = function (a, p) { return a || p.type !== 'literal' && p.type !== 'dayperiod' && _this.getExisting(p.pattern[0]); };\n return this.intl.splitDateFormat(this.format).reduce(pred, false);\n };\n KendoDate.prototype.getDateObject = function () {\n for (var i = 0; i < this.knownParts.length; i++) {\n if (!this.getExisting(this.knownParts[i])) {\n return null;\n }\n }\n return cloneDate(this.value);\n };\n KendoDate.prototype.getTextAndFormat = function () {\n return this.merge(this.intl.formatDate(this.value, this.format), this.dateFormatString(this.value, this.format));\n };\n KendoDate.prototype.modifyExisting = function (value) {\n var sampleFormat = this.dateFormatString(this.value, this.format).symbols;\n for (var i = 0; i < sampleFormat.length; i++) {\n this.setExisting(sampleFormat[i], value);\n }\n };\n KendoDate.prototype.getExisting = function (symbol) {\n switch (symbol) {\n case 'y': return this.year;\n case 'M':\n case 'L': return this.month;\n case 'd': return this.date;\n case 'E': return this.date && this.month && this.year;\n case 'h':\n case 'H': return this.hours;\n case 'm': return this.minutes;\n case 's': return this.seconds;\n default: return true;\n }\n };\n KendoDate.prototype.setExisting = function (symbol, value) {\n switch (symbol) {\n case 'y':\n // allow 2/29 dates\n this.year = value;\n if (value === false) {\n this._value.setFullYear(2000);\n }\n break;\n case 'M':\n // make sure you can type 31 in the day part\n this.month = value;\n if (value === false) {\n this._value.setMonth(0);\n }\n break;\n case 'd':\n this.date = value;\n break;\n case 'h':\n case 'H':\n this.hours = value;\n break;\n case 'm':\n this.minutes = value;\n break;\n case 's':\n this.seconds = value;\n break;\n default: return;\n }\n };\n KendoDate.prototype.modifyPart = function (symbol, offset) {\n var newValue = cloneDate(this.value);\n switch (symbol) {\n case 'y':\n newValue.setFullYear(newValue.getFullYear() + offset);\n break;\n case 'M':\n newValue = addMonths(this.value, offset);\n break;\n case 'd':\n case 'E':\n newValue.setDate(newValue.getDate() + offset);\n break;\n case 'h':\n case 'H':\n newValue.setHours(newValue.getHours() + offset);\n break;\n case 'm':\n newValue.setMinutes(newValue.getMinutes() + offset);\n break;\n case 's':\n newValue.setSeconds(newValue.getSeconds() + offset);\n break;\n case 'a':\n newValue.setHours(newValue.getHours() + (12 * offset));\n break;\n default: break;\n }\n this.setExisting(symbol, true);\n this._value = newValue;\n };\n KendoDate.prototype.parsePart = function (symbol, currentChar) {\n var _a;\n this.resetLeadingZero();\n if (!currentChar) {\n this.setExisting(symbol, false);\n return { value: null };\n }\n var baseDate = this.intl.formatDate(this.value, this.format);\n var dateParts = this.dateFormatString(this.value, this.format);\n var baseFormat = dateParts.symbols;\n var replaced = false;\n var prefix = '';\n var current = '';\n var suffix = '';\n for (var i = 0; i < baseDate.length; i++) {\n if (baseFormat[i] === symbol) {\n current += this.getExisting(symbol) ? baseDate[i] : '0';\n replaced = true;\n }\n else if (!replaced) {\n prefix += baseDate[i];\n }\n else {\n suffix += baseDate[i];\n }\n }\n var parsedDate = null;\n var month = this.matchMonth(currentChar);\n while (current.length > 0 && current.charAt(0) === '0') {\n current = current.slice(1);\n }\n if (current.length >= 4) {\n current = '';\n }\n for (var i = 0; i < 2; i++) {\n var middle = current + currentChar;\n var middleNumber = parseInt(middle, 10);\n parsedDate = this.intl.parseDate(prefix + middle + suffix, this.format);\n if (!parsedDate && !isNaN(middleNumber) && !isNaN(parseInt(currentChar, 10))) {\n if (symbol === 'M' && !month) {\n var monthNumber = middleNumber - 1;\n if (monthNumber > -1 && monthNumber < 12) {\n parsedDate = cloneDate(this.value);\n parsedDate.setMonth(monthNumber);\n if (parsedDate.getMonth() !== monthNumber) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if (symbol === 'y') {\n parsedDate = createDate(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);\n if (this.date && parsedDate.getDate() !== this.value.getDate()) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if (parsedDate) {\n this._value = parsedDate;\n this.setExisting(symbol, true);\n return { value: this.value };\n }\n current = '';\n }\n if (month) {\n parsedDate = this.intl.parseDate(prefix + month + suffix, this.format);\n if (parsedDate) {\n this._value = parsedDate;\n this.setExisting(symbol, true);\n return { value: this.value };\n }\n }\n if (currentChar === '0') {\n this.leadingZero = !this.isAbbrMonth(dateParts.partMap, symbol) ? (_a = {}, _a[symbol] = true, _a) : null;\n this.setExisting(symbol, false);\n }\n return { value: null };\n };\n KendoDate.prototype.symbolMap = function (symbol) {\n return this.intl.splitDateFormat(this.format).reduce(dateSymbolMap, {})[symbol];\n };\n KendoDate.prototype.resetLeadingZero = function () {\n var hasLeadingZero = this.leadingZero !== null;\n this.leadingZero = null;\n return hasLeadingZero;\n };\n KendoDate.prototype.isAbbrMonth = function (parts, symbol) {\n var pattern = this.partPattern(parts, symbol);\n return pattern.type === 'month' && pattern.names;\n };\n KendoDate.prototype.partPattern = function (parts, symbol) {\n return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0];\n };\n KendoDate.prototype.matchMonth = function (typedChar) {\n this.typedMonthPart += typedChar.toLowerCase();\n if (this.monthNames.length === 0) {\n return '';\n }\n while (this.typedMonthPart.length > 0) {\n for (var i = 0; i < this.monthNames.length; i++) {\n if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {\n return this.monthNames[i];\n }\n }\n var monthAsNum = parseInt(this.typedMonthPart, 10);\n /* ensure they exact match */\n if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart) {\n return this.monthNames[monthAsNum - 1];\n }\n this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);\n }\n return '';\n };\n KendoDate.prototype.allFormatedMonths = function () {\n var dateFormatParts = this.intl.splitDateFormat(this.format);\n for (var i = 0; i < dateFormatParts.length; i++) {\n if (dateFormatParts[i].type === 'month' && dateFormatParts[i].names) {\n return this.intl.dateFormatNames(dateFormatParts[i].names);\n }\n }\n return [];\n };\n KendoDate.prototype.dateFormatString = function (date, format) {\n var dateFormatParts = this.intl.splitDateFormat(format);\n var parts = [];\n var partMap = [];\n for (var i = 0; i < dateFormatParts.length; i++) {\n var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }).length;\n while (partLength > 0) {\n parts.push(this.symbols[dateFormatParts[i].pattern[0]] || '_');\n partMap.push(dateFormatParts[i]);\n partLength--;\n }\n }\n var returnValue = new Mask();\n returnValue.symbols = parts.join('');\n returnValue.partMap = partMap;\n return returnValue;\n };\n KendoDate.prototype.merge = function (text, mask) {\n // Important: right to left.\n var resultText = '';\n var resultFormat = '';\n var format = mask.symbols;\n for (var r = format.length - 1; r >= 0; r--) {\n if (this.knownParts.indexOf(format[r]) === -1 || this.getExisting(format[r])) {\n resultText = text[r] + resultText;\n resultFormat = format[r] + resultFormat;\n }\n else {\n var currentSymbol = format[r];\n while (r >= 0 && currentSymbol === format[r]) {\n r--;\n }\n r++;\n if (this.leadingZero && this.leadingZero[currentSymbol]) {\n resultText = '0' + resultText;\n }\n else {\n resultText = this.dateFieldName(mask.partMap[r]) + resultText;\n }\n while (resultFormat.length < resultText.length) {\n resultFormat = format[r] + resultFormat;\n }\n }\n }\n return { text: resultText, format: resultFormat };\n };\n KendoDate.prototype.dateFieldName = function (part) {\n var formatPlaceholder = (this.formatPlaceholder || 'wide');\n if (formatPlaceholder[part.type]) {\n return formatPlaceholder[part.type];\n }\n if (formatPlaceholder === 'formatPattern') {\n return part.pattern;\n }\n return this.intl.dateFieldName(Object.assign(part, { nameType: formatPlaceholder }));\n };\n return KendoDate;\n}());\nexport { KendoDate };\n","import { cloneDate, addDays } from '@progress/kendo-date-math';\nimport { TIME_PART } from './models/TimePart';\nimport { MIDNIGHT_DATE, setTime } from '../utils';\nvar setter = function (method) { return function (date, value) {\n var clone = cloneDate(date);\n clone[method](value);\n return clone;\n}; };\nvar defaultGetters = [\n { type: TIME_PART.hour, getter: function (value) { return value.getHours(); } },\n { type: TIME_PART.minute, getter: function (value) { return value.getMinutes(); } },\n { type: TIME_PART.second, getter: function (value) { return value.getSeconds(); } },\n { type: TIME_PART.millisecond, getter: function (value) { return value.getMilliseconds(); } }\n];\nvar left = function (getter) { return function (origin, _) { return getter(origin); }; };\nvar right = function (getter) { return function (_, candidate) { return getter(candidate); }; };\nvar convertToObject = function (parts) { return parts.reduce(function (obj, p) { obj[p.type] = p.type; return obj; }, {}); };\nvar getterByPart = function (parts) { return function (g) { return parts[g.type] ? right(g.getter) : left(g.getter); }; };\nvar gettersFactory = function (getters) { return function (parts) { return (getters.map(getterByPart(convertToObject(parts)))); }; };\nvar snapValue = function (getter, step, min, type) { return function (date) {\n var value = getter(date);\n var minValue = getter(min);\n if (type === 'hour') {\n return value - ((value - minValue) % step);\n }\n if (date.getTime() <= min.getTime()\n && value !== 0\n && value <= minValue) {\n return (Math.ceil(value / step)) * step;\n }\n return value - (value % step);\n}; };\nvar snappersFactory = function (getters) { return function (steps, min) { return (getters.map(function (g) {\n var step = Math.floor(steps[g.type]);\n return step ? snapValue(g.getter, step, min, g.type) : g.getter;\n})); }; };\n/**\n * @hidden\n */\nexport var generateGetters = gettersFactory(defaultGetters);\n/**\n * @hidden\n */\nexport var generateSnappers = snappersFactory(defaultGetters);\n/**\n * @hidden\n */\nexport var valueMerger = function (getters) { return function (origin, candidate) {\n origin.setHours.apply(origin, getters.map(function (g) { return g(origin, candidate); }));\n return origin;\n}; };\n/**\n * @hidden\n */\nexport var snapTime = function (snappers) { return function (candidate) {\n var date = cloneDate(candidate);\n date.setHours.apply(date, snappers.map(function (s) { return s(date); }));\n return date;\n}; };\n/**\n * @hidden\n */\nexport var setHours = setter('setHours');\n/**\n * @hidden\n */\nexport var setMinutes = setter('setMinutes');\n/**\n * @hidden\n */\nexport var setSeconds = setter('setSeconds');\n/**\n * @hidden\n */\nexport var getNow = function () { return new Date(); };\n/**\n * @hidden\n */\nexport var range = function (start, end, step) {\n if (step === void 0) { step = 1; }\n var result = [];\n for (var i = start; i < end; i = i + step) {\n result.push(i);\n }\n return result;\n};\nvar normalizeTimes = function (candidate, min, max) { return ({\n candidateValue: setTime(MIDNIGHT_DATE, candidate),\n maxValue: addDays(setTime(MIDNIGHT_DATE, max), min.getHours() < max.getHours() ? 0 : 1),\n minValue: setTime(MIDNIGHT_DATE, min)\n}); };\n/**\n * @hidden\n */\nexport var timeInRange = function (candidate, min, max) {\n if (!candidate || !min || !max) {\n return candidate;\n }\n var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;\n if (candidateValue < minValue) {\n return setTime(candidate, min);\n }\n if (candidateValue > maxValue) {\n return setTime(candidate, max);\n }\n return candidate;\n};\n/**\n * @hidden\n */\nexport var isInTimeRange = function (candidate, min, max) {\n if (!candidate || !min || !max) {\n return true;\n }\n var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;\n return minValue <= candidateValue && candidateValue <= maxValue;\n};\n/**\n * @hidden\n */\nexport var isInRange = function (candidate, min, max) {\n if (candidate === null) {\n return true;\n }\n var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;\n return minValue <= candidateValue && candidateValue <= maxValue;\n};\n/**\n * @hidden\n */\nexport var isSmallerThanMin = function (val, min) {\n if (val === null || min === null) {\n return false;\n }\n var normalizedValue = setTime(MIDNIGHT_DATE, val);\n var normalizedMin = setTime(MIDNIGHT_DATE, min);\n return normalizedValue.getTime() < normalizedMin.getHours();\n};\n/**\n * @hidden\n */\nexport var isBiggerThanMax = function (val, max) {\n if (val === null || max === null) {\n return false;\n }\n var normalizedValue = setTime(MIDNIGHT_DATE, val);\n var normalizedMax = setTime(MIDNIGHT_DATE, max);\n return normalizedMax.getTime() < normalizedValue.getHours();\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { isEqual, cloneDate } from '@progress/kendo-date-math';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { caretAltUpIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';\nimport { registerForIntl, provideIntlService, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { KendoDate } from './models';\nimport { guid, AsyncFocusBlur, noop, classNames, createPropsContext, withPropsContext, kendoThemeMaps, getActiveElement } from '@progress/kendo-react-common';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\nimport { validatePackage } from '@progress/kendo-react-common';\nimport { packageMetadata } from '../package-metadata';\nimport { approximateStringMatching, defaultFormat, defaultFormatPlaceholder, isInRange, wrapperClasses } from './utils';\nimport { MAX_DATE, MIN_DATE } from './../utils';\nimport { messages, increaseValue, decreaseValue } from './../messages';\nimport { isInTimeRange } from '../timepicker/utils';\nimport { MIN_TIME, MAX_TIME } from '../utils';\nvar VALIDATION_MESSAGE = 'Please enter a valid value!';\n// tslint:enable:max-line-length\n/** @hidden */\nvar DateInputWithoutContext = /** @class */ (function (_super) {\n __extends(DateInputWithoutContext, _super);\n function DateInputWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n _this.kendoDate = null;\n _this.currentFormat = '';\n _this.paste = false;\n _this._element = null;\n _this._wrapper = null;\n _this._inputId = guid();\n _this._lastSelectedSymbol = '';\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this._element) {\n _this._element.focus();\n }\n };\n /**\n * @hidden\n */\n _this.setValidity = function () {\n if (_this.element && _this.element.setCustomValidity) {\n _this.element.setCustomValidity(_this.validity.valid\n ? ''\n : _this.props.validationMessage || DateInputWithoutContext.defaultProps.validationMessage);\n }\n };\n _this.updateOnPaste = function (event) {\n if (!_this.element || !_this.kendoDate) {\n return;\n }\n var value = provideIntlService(_this).parseDate(_this.element.value, _this.props.format) || _this.value;\n var oldValue = _this.value;\n _this.kendoDate.setValue(value);\n _this.triggerChange(event, oldValue);\n };\n /* Handlers */\n _this.spinnersMouseDown = function (event) {\n /* do not steal focus from input when changing value with spinners */\n event.preventDefault();\n var activeElement = getActiveElement(document);\n /* manually focus the input in case the user clicks the spinners first */\n if (_this.element && activeElement !== _this.element) {\n _this.element.focus({ preventScroll: true });\n }\n };\n _this.handlePaste = function () {\n _this.paste = true;\n };\n _this.elementChange = function (event) {\n if (!_this.element || !_this.kendoDate) {\n return;\n }\n if (_this.paste) {\n _this.updateOnPaste(event);\n _this.paste = false;\n return;\n }\n var _a = _this.kendoDate.getTextAndFormat(), text = _a.text, currentFormat = _a.format;\n _this.currentFormat = currentFormat;\n var dateBeforeChange = _this.value;\n var diff = approximateStringMatching(text, _this.currentFormat, _this.element.value, _this.selection.start);\n var navigationOnly = (diff.length === 1 && diff[0][1] === '_');\n if (!navigationOnly) {\n for (var i = 0; i < diff.length; i++) {\n _this.kendoDate.parsePart(diff[i][0], diff[i][1]);\n }\n }\n if (diff.length && diff[0][0] !== '_') {\n _this.setSelection(_this.selectionBySymbol(diff[0][0]));\n }\n if (navigationOnly) {\n _this.switchDateSegment(1);\n }\n _this.triggerChange(event, dateBeforeChange);\n };\n _this.elementClick = function (_) {\n _this.setSelection(_this.selectionByIndex(_this.selection.start));\n };\n _this.nativeWheel = function (event) {\n var activeElement = getActiveElement(document);\n if (activeElement === _this.element) {\n event.preventDefault();\n }\n };\n _this.wheel = function (event) {\n var activeElement = getActiveElement(document);\n if (activeElement !== _this.element) {\n return;\n }\n if (event.nativeEvent.deltaY < 0) {\n _this.increasePart(event);\n }\n if (event.nativeEvent.deltaY > 0) {\n _this.decreasePart(event);\n }\n };\n _this.increasePart = function (event) {\n _this.modifyDateSegmentValue(1, event);\n };\n _this.decreasePart = function (event) {\n _this.modifyDateSegmentValue(-1, event);\n };\n _this.elementKeyDown = function (event) {\n if (event.altKey) {\n return;\n }\n switch (event.keyCode) {\n case 37:\n /*\n * Key: `Left Arrow`\n * Action: Switches to previous logical* segment.\n * (*) https://www.w3.org/International/articles/inline-bidi-markup/uba-basics\n */\n _this.switchDateSegment(-1);\n break;\n case (38):\n /*\n * Key: `Up Arrow`\n * Action: Increases the currently selected segment value.\n */\n _this.modifyDateSegmentValue(1, event);\n break;\n case 39:\n /*\n * Key: `Right Arrow`\n * Action: Switches to the next logical segment.\n */\n _this.switchDateSegment(1);\n break;\n case 40:\n /*\n * Key: `Down Arrow`\n * Action: Decreases the currently selected segment value.\n */\n _this.modifyDateSegmentValue(-1, event);\n break;\n default:\n /*\n * Key: any\n * Action: Does not prevent the default behavior.\n */\n return;\n }\n event.preventDefault();\n };\n _this.elementOnFocus = function (_) {\n if (_this.wrapper) {\n _this.wrapper.classList.add('k-focus');\n }\n _this.setState({ focused: true });\n };\n _this.elementOnBlur = function (_) {\n if (_this.wrapper) {\n _this.wrapper.classList.remove('k-focus');\n }\n _this.setState({ focused: false });\n };\n validatePackage(packageMetadata);\n _this.state = {\n focused: false\n };\n return _this;\n }\n /**\n * @hidden\n */\n DateInputWithoutContext.prototype.componentDidMount = function () {\n this.setValidity();\n if (this.wrapper) {\n this.wrapper.addEventListener('wheel', this.nativeWheel, { passive: false });\n }\n };\n /**\n * @hidden\n */\n DateInputWithoutContext.prototype.componentDidUpdate = function (_, prevState) {\n if (this._lastSelectedSymbol && prevState.focused === this.state.focused) {\n this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol));\n }\n else if (this.props.placeholder !== undefined && this.selection.start === this.selection.end) {\n this.setSelection({ start: 0, end: this.currentFormat.length });\n }\n this.setValidity();\n };\n /**\n * @hidden\n */\n DateInputWithoutContext.prototype.componentWillUnmount = function () {\n if (this.wrapper) {\n this.wrapper.removeEventListener('wheel', this.nativeWheel);\n }\n };\n /**\n * @hidden\n */\n DateInputWithoutContext.prototype.render = function () {\n var _this = this;\n var _a = this.props, _b = _a.size, size = _b === void 0 ? DateInputWithoutContext.defaultProps.size : _b, _c = _a.fillMode, fillMode = _c === void 0 ? DateInputWithoutContext.defaultProps.fillMode : _c, _d = _a.rounded, rounded = _d === void 0 ? DateInputWithoutContext.defaultProps.rounded : _d;\n if (this.props._ref) {\n this.props._ref.current = this;\n }\n var localizationService = provideLocalizationService(this);\n var props = __assign(__assign({}, DateInputWithoutContext.defaultProps), this.props);\n var name = props.name, label = props.label, id = props.id;\n var currentText = this.text;\n var text = currentText === this.props.placeholder ? '' : currentText;\n var placeholder = currentText === this.props.placeholder ? currentText : undefined;\n var inputId = id || this._inputId;\n var isValid = !this.validityStyles || this.validity.valid;\n var wrapperClassesInstance = __spreadArray([], wrapperClasses, true);\n if (this.props.className) {\n wrapperClassesInstance.push(this.props.className);\n }\n var dateinput = (React.createElement(AsyncFocusBlur, { onFocus: this.elementOnFocus, onBlur: this.elementOnBlur }, function (_a) {\n var _b;\n var onFocus = _a.onFocus, onBlur = _a.onBlur;\n return (React.createElement(\"span\", { ref: function (span) { _this._wrapper = span; }, style: !label\n ? { width: _this.props.width }\n : undefined, dir: _this.props.dir, className: classNames('k-dateinput', 'k-input', (_b = {},\n _b[\"k-input-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _b[\"k-input-\".concat(fillMode)] = fillMode,\n _b[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,\n _b['k-invalid'] = !isValid,\n _b['k-required'] = _this.required,\n _b['k-disabled'] = _this.props.disabled,\n _b), _this.props.className), onFocus: onFocus, onBlur: onBlur },\n React.createElement(\"input\", { role: _this.props.ariaRole || 'textbox', readOnly: _this.props.readonly, tabIndex: _this.props.tabIndex, disabled: _this.props.disabled, title: _this.props.title !== undefined ? _this.props.title : currentText, type: \"text\", spellCheck: false, autoComplete: \"off\", autoCorrect: \"off\", className: \"k-input-inner\", id: inputId, \"aria-label\": _this.props.ariaLabel, \"aria-labelledby\": _this.props.ariaLabelledBy, \"aria-describedby\": _this.props.ariaDescribedBy, \"aria-haspopup\": _this.props.ariaHasPopup, \"aria-disabled\": _this.props.disabled, \"aria-expanded\": _this.props.ariaExpanded, \"aria-controls\": _this.props.ariaControls, onWheel: _this.wheel, onClick: _this.elementClick, onInput: _this.elementChange, onPaste: _this.handlePaste, onKeyDown: _this.elementKeyDown, onChange: noop, value: text, placeholder: placeholder, name: name, ref: function (input) { return _this._element = input; } }),\n _this.props.children,\n _this.props.spinners && (React.createElement(\"span\", { className: \"k-input-spinner k-spin-button\", onMouseDown: _this.spinnersMouseDown },\n React.createElement(Button, { tabIndex: -1, type: \"button\", rounded: null, className: \"k-spinner-increase\", icon: 'caret-alt-up', svgIcon: caretAltUpIcon, \"aria-label\": localizationService.toLanguageString(increaseValue, messages[increaseValue]), title: localizationService.toLanguageString(increaseValue, messages[increaseValue]), onClick: _this.increasePart }),\n React.createElement(Button, { tabIndex: -1, type: \"button\", rounded: null, className: \"k-spinner-decrease\", icon: 'caret-alt-down', svgIcon: caretAltDownIcon, \"aria-label\": localizationService.toLanguageString(decreaseValue, messages[decreaseValue]), title: localizationService.toLanguageString(decreaseValue, messages[decreaseValue]), onClick: _this.decreasePart })))));\n }));\n return label\n ? (React.createElement(FloatingLabel, { label: label, editorId: inputId, editorValue: currentText, editorValid: isValid, editorDisabled: this.props.disabled, children: dateinput, style: { width: this.props.width } }))\n : dateinput;\n };\n Object.defineProperty(DateInputWithoutContext.prototype, \"value\", {\n /* Public Getters */\n /**\n * Gets the value of the DateInput.\n */\n get: function () {\n if (this.valueDuringOnChange !== undefined) {\n return this.valueDuringOnChange;\n }\n return this.kendoDate && this.kendoDate.getDateObject();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the DateInput.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"min\", {\n get: function () {\n return this.props.min !== undefined\n ? this.props.min\n : DateInputWithoutContext.defaultProps.min;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"max\", {\n get: function () {\n return this.props.max !== undefined\n ? this.props.max\n : DateInputWithoutContext.defaultProps.max;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"text\", {\n /**\n * @hidden\n */\n get: function () {\n var props = __assign(__assign({}, DateInput.defaultProps), this.props);\n var _a = props.formatPlaceholder, formatPlaceholder = _a === void 0 ? DateInputWithoutContext.defaultProps.formatPlaceholder : _a, _b = props.format, format = _b === void 0 ? DateInputWithoutContext.defaultProps.format : _b, value = props.value, defaultValue = props.defaultValue;\n if (this.kendoDate === null) {\n this.kendoDate = new KendoDate(this.intl.bind(this), formatPlaceholder, format);\n this.kendoDate.setValue(value || defaultValue || null);\n }\n else {\n this.kendoDate.format = format;\n this.kendoDate.formatPlaceholder = formatPlaceholder;\n }\n if (value !== undefined && this.value !== value) {\n this.kendoDate.setValue(value);\n }\n var _c = this.kendoDate.getTextAndFormat(), currentText = _c.text, currentFormat = _c.format;\n this.currentFormat = currentFormat;\n return props.placeholder !== null && props.placeholder !== undefined\n && !this.state.focused\n && !this.kendoDate.hasValue()\n ? props.placeholder\n : currentText;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the DateInput is set.\n */\n get: function () {\n var inRange = isInRange(this.value, this.min, this.max)\n && isInTimeRange(this.value, this.props.minTime, this.props.maxTime);\n var customError = this.props.validationMessage !== undefined;\n var isValid = (!this.required || this.value !== null) && inRange;\n var valid = this.props.valid !== undefined ? this.props.valid : isValid;\n return {\n customError: customError,\n rangeOverflow: (this.value && this.max.getTime() < this.value.getTime()) || false,\n rangeUnderflow: (this.value && this.value.getTime() < this.min.getTime()) || false,\n valid: valid,\n valueMissing: this.value === null\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"element\", {\n /**\n * Gets the element of the DateInput.\n *\n * @return - An `HTMLInputElement`.\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * constructor(props) {\n * super(props);\n * }\n * element = null;\n * render() {\n * return (\n *
    \n * \n * this.element = dateInput ? dateInput.element : null}\n * />\n * \n *
    \n * );\n * }\n * }\n *\n * ReactDOM.render(\n * ,\n * document.getElementsByTagName('my-app')[0]\n * );\n * ```\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"validityStyles\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : DateInputWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"required\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : DateInputWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DateInputWithoutContext.prototype, \"wrapper\", {\n /**\n * @hidden\n */\n get: function () {\n return this._wrapper;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n DateInputWithoutContext.prototype.intl = function () {\n return provideIntlService(this);\n };\n Object.defineProperty(DateInputWithoutContext.prototype, \"selection\", {\n /* end handlers */\n get: function () {\n var returnValue = { start: 0, end: 0 };\n if (this.element !== null && this.element.selectionStart !== undefined) {\n returnValue = { start: this.element.selectionStart, end: this.element.selectionEnd };\n }\n return returnValue;\n },\n enumerable: false,\n configurable: true\n });\n DateInputWithoutContext.prototype.setSelection = function (selection) {\n var _this = this;\n this._lastSelectedSymbol = this.currentFormat[selection.start];\n window.requestAnimationFrame(function () {\n var activeElement = getActiveElement(document);\n if (_this.element && activeElement === _this.element && !_this.props.disableSelection) {\n _this.element.setSelectionRange(selection.start, selection.end);\n }\n });\n };\n DateInputWithoutContext.prototype.triggerChange = function (event, oldValue) {\n this.valueDuringOnChange = this.value;\n this.forceUpdate();\n if (this.props.onChange\n && !isEqual(oldValue, this.value)) {\n // isEqual works with null\n this.props.onChange.call(undefined, {\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n value: this.value,\n target: this\n // inRange: this.props.min && this.props.max ? isInRange(value, this.props.min, this.props.max) : true\n });\n }\n this.valueDuringOnChange = undefined;\n };\n DateInputWithoutContext.prototype.selectionBySymbol = function (symbol) {\n var start = -1;\n var end = 0;\n for (var i = 0; i < this.currentFormat.length; i++) {\n if (this.currentFormat[i] === symbol) {\n end = i + 1;\n if (start === -1) {\n start = i;\n }\n }\n }\n if (start < 0) {\n start = 0;\n }\n return { start: start, end: end };\n };\n DateInputWithoutContext.prototype.selectionByIndex = function (index) {\n // console.log(42, index);\n var selection = { start: index, end: index };\n for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {\n if (i < this.currentFormat.length && this.currentFormat[i] !== '_') {\n selection = this.selectionBySymbol(this.currentFormat[i]);\n break;\n }\n if (j >= 0 && this.currentFormat[j] !== '_') {\n selection = this.selectionBySymbol(this.currentFormat[j]);\n break;\n }\n }\n return selection;\n };\n DateInputWithoutContext.prototype.switchDateSegment = function (offset) {\n var _a = this.selection, selectionStart = _a.start, selectionEnd = _a.end;\n if (selectionStart < selectionEnd &&\n this.currentFormat[selectionStart] !== this.currentFormat[selectionEnd - 1]) {\n this.setSelection(this.selectionByIndex(offset > 0 ? selectionStart : selectionEnd - 1));\n return;\n }\n var previousFormatSymbol = this.currentFormat[selectionStart];\n var a = selectionStart + offset;\n while (a > 0 && a < this.currentFormat.length) {\n if (this.currentFormat[a] !== previousFormatSymbol &&\n this.currentFormat[a] !== '_') {\n break;\n }\n a += offset;\n }\n if (this.currentFormat[a] === '_') {\n // no known symbol is found\n return;\n }\n var b = a;\n while (b >= 0 && b < this.currentFormat.length) {\n if (this.currentFormat[b] !== this.currentFormat[a]) {\n break;\n }\n b += offset;\n }\n if (a > b && (b + 1 !== selectionStart || a + 1 !== selectionEnd)) {\n this.setSelection({ start: b + 1, end: a + 1 });\n }\n else if (a < b && (a !== selectionStart || b !== selectionEnd)) {\n this.setSelection({ start: a, end: b });\n }\n };\n DateInputWithoutContext.prototype.modifyDateSegmentValue = function (offset, event) {\n if (!this.kendoDate) {\n return;\n }\n var oldValue = this.value;\n var symbol = this.currentFormat[this.selection.start];\n var currentStepSymbol = this.kendoDate.symbolMap(symbol);\n var step = ((this.props.steps || {})[currentStepSymbol] || 1) * offset;\n this.kendoDate.modifyPart(symbol, step);\n this.triggerChange(event, oldValue);\n };\n /**\n * @hidden\n */\n DateInputWithoutContext.displayName = 'DateInput';\n /**\n * @hidden\n */\n DateInputWithoutContext.propTypes = {\n value: PropTypes.instanceOf(Date),\n format: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n skeleton: PropTypes.string,\n pattern: PropTypes.string,\n date: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n time: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n datetime: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n era: PropTypes.oneOf(['narrow', 'short', 'long']),\n year: PropTypes.oneOf(['numeric', '2-digit']),\n month: PropTypes.oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),\n day: PropTypes.oneOf(['numeric', '2-digit']),\n weekday: PropTypes.oneOf(['narrow', 'short', 'long']),\n hour: PropTypes.oneOf(['numeric', '2-digit']),\n hour12: PropTypes.bool,\n minute: PropTypes.oneOf(['numeric', '2-digit']),\n second: PropTypes.oneOf(['numeric', '2-digit']),\n timeZoneName: PropTypes.oneOf(['short', 'long'])\n })\n ]),\n formatPlaceholder: PropTypes.oneOfType([\n PropTypes.oneOf(['wide', 'narrow', 'short', 'formatPattern']),\n PropTypes.shape({\n year: PropTypes.string,\n month: PropTypes.string,\n day: PropTypes.string,\n hour: PropTypes.string,\n minute: PropTypes.string,\n second: PropTypes.string\n })\n ]),\n width: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ]),\n tabIndex: PropTypes.number,\n title: PropTypes.string,\n steps: PropTypes.shape({\n year: PropTypes.number,\n month: PropTypes.number,\n day: PropTypes.number,\n hour: PropTypes.number,\n minute: PropTypes.number,\n second: PropTypes.number\n }),\n min: PropTypes.instanceOf(Date),\n max: PropTypes.instanceOf(Date),\n disabled: PropTypes.bool,\n spinners: PropTypes.bool,\n name: PropTypes.string,\n dir: PropTypes.string,\n label: PropTypes.string,\n id: PropTypes.string,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n ariaLabel: PropTypes.string,\n ariaRole: PropTypes.string,\n ariaHasPopup: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.string\n ]),\n ariaExpanded: PropTypes.oneOfType([\n PropTypes.bool\n ]),\n onChange: PropTypes.func,\n validationMessage: PropTypes.string,\n required: PropTypes.bool,\n validate: PropTypes.bool,\n valid: PropTypes.bool,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])\n };\n /**\n * @hidden\n */\n DateInputWithoutContext.defaultProps = {\n format: defaultFormat,\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid',\n formatPlaceholder: defaultFormatPlaceholder,\n // defaultValue: null as Date | null,\n spinners: false,\n disabled: false,\n max: cloneDate(MAX_DATE),\n min: cloneDate(MIN_DATE),\n minTime: cloneDate(MIN_TIME),\n maxTime: cloneDate(MAX_TIME),\n required: false,\n validityStyles: true,\n validationMessage: VALIDATION_MESSAGE,\n placeholder: null,\n // the rest of the properties are undefined by default\n ariaHasPopup: 'grid'\n };\n return DateInputWithoutContext;\n}(React.Component));\nexport { DateInputWithoutContext };\n/**\n * Represents the PropsContext of the `DateInput` component.\n * Used for global configuration of all `DateInput` instances.\n *\n * For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.\n */\nexport var DateInputPropsContext = createPropsContext();\n;\n/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */\n/**\n * Represents the KendoReact DateInput Component.\n *\n * Accepts properties of type [DateInputProps]({% slug api_dateinputs_dateinputprops %}).\n * Obtaining the `ref` returns an object of type [DateInputHandle]({% slug api_dateinputs_dateinputhandle %}).\n */\nexport var DateInput = withPropsContext(DateInputPropsContext, DateInputWithoutContext);\nDateInput.displayName = 'KendoReactDateInput';\nregisterForIntl(DateInputWithoutContext);\nregisterForLocalization(DateInputWithoutContext);\n","import { Button } from '@progress/kendo-react-buttons';\n/**\n * Represents the default `toggleButton` component rendered by the [KendoReact Scheduler DatePicker]({% slug overview_datepicker %}).\n */\nexport var ToggleButton = Button;\n","import * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n * @deprecated\n */\nexport var PickerWrap = React.forwardRef(function (props, ref) {\n var _ref = props._ref;\n var element = React.useRef(null);\n React.useImperativeHandle(ref, function () { return element.current; });\n React.useImperativeHandle(_ref, function () { return element.current; });\n var className = React.useMemo(function () { return classNames(props.className, 'k-picker-wrap'); }, [props.className]);\n return (React.createElement(\"span\", { ref: element, id: props.id, style: props.style, className: className, tabIndex: props.tabIndex }, props.children));\n});\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { FloatingLabel } from '@progress/kendo-react-labels';\n/**\n * @hidden\n */\nexport var usePickerFloatingLabel = function (dateInput) {\n var _a = React.useState(false), show = _a[0], setShow = _a[1];\n var syncText = function () {\n if (dateInput.current) {\n setShow(Boolean(dateInput.current.text));\n }\n };\n React.useEffect(syncText);\n return {\n editorValue: show\n };\n};\n/**\n * @hidden\n */\nexport var PickerFloatingLabel = function (props) {\n var floatingLabelProps = usePickerFloatingLabel(props.dateInput);\n return (React.createElement(FloatingLabel, __assign({}, props, floatingLabelProps)));\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { ActionSheet, ActionSheetFooter, ActionSheetHeader } from '@progress/kendo-react-layout';\nimport { xIcon } from '@progress/kendo-svg-icons';\nimport { Button } from '@progress/kendo-react-buttons';\n/** @hidden */\nvar MOBILE_SMALL_DEVISE = 500;\n/** @hidden */\nexport var AdaptiveMode = function (props) {\n var footer = props.footer, children = props.children, _a = props.windowWidth, windowWidth = _a === void 0 ? 0 : _a, navigatable = props.navigatable, navigatableElements = props.navigatableElements, expand = props.expand, animation = props.animation, onClose = props.onClose, adaptiveTitle = props.adaptiveTitle, mobileFilter = props.mobileFilter;\n var defaultProps = {\n navigatable: navigatable || false,\n navigatableElements: navigatableElements || [],\n expand: expand,\n animation: animation === false ? false : true,\n onClose: onClose,\n animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,\n className: windowWidth <= MOBILE_SMALL_DEVISE\n ? 'k-adaptive-actionsheet k-actionsheet-fullscreen'\n : 'k-adaptive-actionsheet k-actionsheet-bottom'\n };\n return (React.createElement(ActionSheet, __assign({}, defaultProps),\n React.createElement(ActionSheetHeader, { className: 'k-text-center' },\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-hbox\" },\n React.createElement(\"div\", { className: \"k-actionsheet-title\" },\n React.createElement(\"div\", null, adaptiveTitle)),\n React.createElement(\"div\", { className: \"k-actionsheet-actions\" },\n React.createElement(Button, { tabIndex: 0, \"aria-label\": \"Cancel\", \"aria-disabled\": \"false\", type: \"button\", fillMode: \"flat\", icon: 'x', svgIcon: xIcon, onClick: onClose }))),\n mobileFilter &&\n React.createElement(\"div\", { className: \"k-actionsheet-titlebar-group k-actionsheet-filter\" }, mobileFilter)),\n children,\n footer && React.createElement(ActionSheetFooter, { className: 'k-actions k-actions-stretched' },\n React.createElement(Button, { size: \"large\", tabIndex: 0, \"aria-label\": footer.cancelText, \"aria-disabled\": \"false\", type: \"button\", onClick: footer.onCancel }, footer.cancelText),\n React.createElement(Button, { tabIndex: 0, themeColor: \"primary\", size: \"large\", \"aria-label\": footer.applyText, \"aria-disabled\": \"false\", type: \"button\", onClick: footer.onApply }, footer.applyText))));\n};\n","/** @hidden */\nexport var MOBILE_SMALL_DEVISE = 500;\n/** @hidden */\nexport var MOBILE_MEDIUM_DEVISE = 768;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Popup } from '@progress/kendo-react-popup';\nimport { getDate, cloneDate } from '@progress/kendo-date-math';\nimport { classNames, guid, Keys, AsyncFocusBlur, createPropsContext, withPropsContext, validatePackage, kendoThemeMaps, canUseDOM } from '@progress/kendo-react-common';\nimport { calendarIcon } from '@progress/kendo-svg-icons';\nimport { packageMetadata } from '../package-metadata';\nimport { DateInput } from '../dateinput/DateInput';\nimport { Calendar } from '../calendar/components/Calendar';\nimport { MIN_DATE, MAX_DATE, setTime } from '../utils';\nimport { isInDateRange } from '../utils';\nimport { messages, toggleCalendar } from '../messages';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { ToggleButton } from './ToggleButton';\nimport { PickerWrap } from '../common/PickerWrap';\nimport { PickerFloatingLabel } from '../hooks/usePickerFloatingLabel';\nimport { ActionSheetContent } from '@progress/kendo-react-layout';\nimport { AdaptiveMode } from '../common/AdaptiveMode';\nimport { MOBILE_MEDIUM_DEVISE } from '../common/constants';\n/** @hidden */\nvar DatePickerWithoutContext = /** @class */ (function (_super) {\n __extends(DatePickerWithoutContext, _super);\n function DatePickerWithoutContext(props) {\n var _this = _super.call(this, props) || this;\n _this._popupId = guid();\n _this._element = null;\n _this._dateInput = React.createRef();\n _this._calendar = null;\n _this.shouldFocusDateInput = false;\n _this.prevShow = false;\n /**\n * @hidden\n */\n _this.focus = function () {\n if (_this.dateInput) {\n _this.dateInput.focus();\n }\n };\n _this.setCalendarRef = function (calendar) {\n _this._calendar = calendar;\n };\n _this.nextValue = function (nextProps, nextState) {\n return nextProps.value !== undefined\n ? nextProps.value\n : nextState.value;\n };\n _this.nextShow = function (nextProps, nextState) {\n return nextProps.show !== undefined\n ? nextProps.show\n : nextState.show;\n };\n _this.renderPopup = function () {\n var _a = _this.props, disabled = _a.disabled, min = _a.min, max = _a.max, weekNumber = _a.weekNumber, focusedDate = _a.focusedDate;\n var _b = _this.props.popupSettings, popupClass = _b.popupClass, otherPopupSettings = __rest(_b, [\"popupClass\"]);\n var show = _this.show;\n var value = _this.value;\n var sanitizedValue = value && getDate(value);\n var popupClassNames = classNames('k-calendar-container k-group k-reset', popupClass);\n var popupProps = __assign({ popupClass: 'k-datepicker-popup', show: show, anchor: _this._element, className: popupClassNames, id: _this._popupId, anchorAlign: {\n horizontal: 'left',\n vertical: 'bottom'\n }, popupAlign: {\n horizontal: 'left',\n vertical: 'top'\n } }, otherPopupSettings);\n var calendarProps = {\n disabled: disabled,\n value: sanitizedValue,\n min: min,\n max: max,\n weekNumber: weekNumber,\n focusedDate: focusedDate,\n className: _this.mobileMode ? 'k-calendar-lg' : '',\n navigation: _this.mobileMode ? false : true,\n onChange: _this.handleCalendarValueChange\n };\n if (_this.mobileMode) {\n return React.createElement(_this.calendarComp, __assign({ _ref: _this.setCalendarRef }, calendarProps));\n }\n return (React.createElement(_this.popupComp, __assign({}, popupProps),\n React.createElement(_this.calendarComp, __assign({ _ref: _this.setCalendarRef }, calendarProps))));\n };\n _this.renderAdaptivePopup = function () {\n var _a = _this.state.windowWidth, windowWidth = _a === void 0 ? 0 : _a;\n var actionSheetProps = {\n expand: _this.show,\n onClose: _this.handleBlur,\n adaptiveTitle: _this.props.adaptiveTitle,\n windowWidth: windowWidth\n };\n return (React.createElement(AdaptiveMode, __assign({}, actionSheetProps),\n React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' }, _this.renderPopup())));\n };\n _this.handleInputValueChange = function (event) {\n _this.handleValueChange(event.value, event);\n };\n _this.handleCalendarValueChange = function (event) {\n var value = _this.mergeTime(event.value);\n _this.handleValueChange(value, event);\n };\n _this.handleValueChange = function (value, event) {\n _this.setState({\n value: cloneDate(value || undefined)\n });\n _this.valueDuringOnChange = value;\n _this.showDuringOnChange = false;\n if (!_this.mobileMode) {\n _this.shouldFocusDateInput = true;\n }\n var onChange = _this.props.onChange;\n if (onChange) {\n onChange.call(undefined, {\n syntheticEvent: event.syntheticEvent,\n nativeEvent: event.nativeEvent,\n value: _this.value,\n show: _this.show,\n target: _this\n });\n }\n _this.valueDuringOnChange = undefined;\n _this.showDuringOnChange = undefined;\n _this.setShow(false);\n };\n _this.handleFocus = function () {\n _this.setState({ focused: true });\n };\n _this.handleBlur = function () {\n _this.setState({ focused: false });\n _this.setShow(false);\n };\n _this.handleIconClick = function () {\n if (_this.props.disabled) {\n return;\n }\n _this.shouldFocusDateInput = true;\n _this.setShow(!_this.show);\n };\n _this.handleIconMouseDown = function (event) {\n event.preventDefault();\n };\n _this.handleKeyDown = function (event) {\n var altKey = event.altKey, keyCode = event.keyCode;\n if (keyCode === Keys.esc) {\n _this.shouldFocusDateInput = true;\n _this.setShow(false);\n return;\n }\n if (altKey && (keyCode === Keys.up || keyCode === Keys.down)) {\n event.preventDefault();\n event.stopPropagation();\n _this.shouldFocusDateInput = keyCode === Keys.up;\n _this.setShow(keyCode === Keys.down);\n }\n };\n validatePackage(packageMetadata);\n _this.state = {\n value: _this.props.defaultValue || DatePickerWithoutContext.defaultProps.defaultValue,\n show: _this.props.defaultShow || DatePickerWithoutContext.defaultProps.defaultShow,\n focused: false\n };\n return _this;\n }\n Object.defineProperty(DatePickerWithoutContext.prototype, \"document\", {\n get: function () {\n if (!canUseDOM) {\n return;\n }\n // useful only for user actions\n return (this.element && this.element.ownerDocument) || document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"element\", {\n /**\n * Gets the wrapping element of the DatePickerWithoutContext.\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"mobileMode\", {\n /**\n * The mobile mode of the DatePicker.\n */\n get: function () {\n var isAdaptive = this.state.windowWidth && this.state.windowWidth <= MOBILE_MEDIUM_DEVISE && this.props.adaptive;\n return !!isAdaptive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"dateInput\", {\n /**\n * Gets the DateInput component inside the DatePicker component.\n */\n get: function () {\n return this._dateInput.current;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"calendar\", {\n /**\n * Gets the Calendar component inside the DatePicker component.\n */\n get: function () {\n return this._calendar;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"value\", {\n /**\n * Gets the value of the DatePickerWithoutContext.\n */\n get: function () {\n var value = this.valueDuringOnChange !== undefined\n ? this.valueDuringOnChange\n : this.props.value !== undefined\n ? this.props.value\n : this.state.value;\n return (value !== null) ? cloneDate(value) : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"show\", {\n /**\n * Gets the popup state of the DatePickerWithoutContext.\n */\n get: function () {\n return this.showDuringOnChange !== undefined\n ? this.showDuringOnChange\n : this.props.show !== undefined\n ? this.props.show\n : this.state.show;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"name\", {\n /**\n * Gets the `name` property of the DatePickerWithoutContext.\n */\n get: function () {\n return this.props.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"min\", {\n get: function () {\n return this.props.min !== undefined\n ? this.props.min\n : DatePickerWithoutContext.defaultProps.min;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"max\", {\n get: function () {\n return this.props.max !== undefined\n ? this.props.max\n : DatePickerWithoutContext.defaultProps.max;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"dateInputComp\", {\n get: function () {\n return this.props.dateInput || DatePickerWithoutContext.defaultProps.dateInput;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"toggleButtonComp\", {\n get: function () {\n return this.props.toggleButton || DatePickerWithoutContext.defaultProps.toggleButton;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"calendarComp\", {\n get: function () {\n return this.props.calendar || DatePickerWithoutContext.defaultProps.calendar;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"popupComp\", {\n get: function () {\n return this.props.popup || DatePickerWithoutContext.defaultProps.popup;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"pickerWrapComp\", {\n get: function () {\n return this.props.pickerWrap || DatePickerWithoutContext.defaultProps.pickerWrap;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"validity\", {\n /**\n * Represents the validity state into which the DatePicker is set.\n */\n get: function () {\n var inRange = isInDateRange(this.value, this.min, this.max);\n var customError = this.props.validationMessage !== undefined;\n var isValid = (!this.required || this.value !== null) && inRange;\n var valid = this.props.valid !== undefined ? this.props.valid : isValid;\n return {\n customError: customError,\n rangeOverflow: (this.value && this.max.getTime() < this.value.getTime()) || false,\n rangeUnderflow: (this.value && this.value.getTime() < this.min.getTime()) || false,\n valid: valid,\n valueMissing: this.value === null\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"validityStyles\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.validityStyles !== undefined\n ? this.props.validityStyles\n : DatePickerWithoutContext.defaultProps.validityStyles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DatePickerWithoutContext.prototype, \"required\", {\n /**\n * @hidden\n */\n get: function () {\n return this.props.required !== undefined\n ? this.props.required\n : DatePickerWithoutContext.defaultProps.required;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n DatePickerWithoutContext.prototype.componentDidMount = function () {\n var _a;\n this.observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this));\n if (this.show) {\n // If defaultShow is true during the initial render, the popup is not aligned.\n this.forceUpdate();\n }\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.observe(this.document.body);\n }\n };\n /**\n * @hidden\n */\n DatePickerWithoutContext.prototype.componentDidUpdate = function () {\n if (this._calendar && this._calendar.element && this.show && !this.prevShow) {\n this._calendar.element.focus({ preventScroll: true });\n }\n if (this.dateInput\n && this.dateInput.element\n && !this.show\n && this.shouldFocusDateInput) {\n this.dateInput.element.focus({ preventScroll: true });\n }\n this.prevShow = this.show;\n this.shouldFocusDateInput = false;\n };\n /**\n * @hidden\n */\n DatePickerWithoutContext.prototype.componentWillUnmount = function () {\n var _a;\n clearTimeout(this.nextTickId);\n if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {\n this.observerResize.disconnect();\n }\n };\n /**\n * @hidden\n */\n DatePickerWithoutContext.prototype.render = function () {\n var _this = this;\n var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, ariaLabel = _a.ariaLabel;\n var show = this.show;\n var value = this.value;\n var isValid = !this.validityStyles || this.validity.valid;\n var dateInputProps = {\n disabled: disabled,\n format: format,\n formatPlaceholder: formatPlaceholder,\n id: id,\n ariaLabelledBy: ariaLabelledBy,\n ariaDescribedBy: ariaDescribedBy,\n ariaLabel: ariaLabel,\n max: max,\n min: min,\n name: name,\n onChange: this.handleInputValueChange,\n required: required,\n tabIndex: !show ? tabIndex : -1,\n title: title,\n valid: this.validity.valid,\n validationMessage: validationMessage,\n validityStyles: validityStyles,\n value: value,\n label: undefined,\n placeholder: !this.state.focused ? this.props.placeholder : null,\n ariaExpanded: this.show,\n size: null,\n fillMode: null,\n rounded: null\n };\n var toggleButtonTitle = provideLocalizationService(this)\n .toLanguageString(toggleCalendar, messages[toggleCalendar]);\n var datepicker = (React.createElement(AsyncFocusBlur, { onFocus: this.handleFocus, onBlur: this.mobileMode ? undefined : this.handleBlur, onSyncBlur: this.props.onBlur, onSyncFocus: this.props.onFocus }, function (_a) {\n var _b;\n var onFocus = _a.onFocus, onBlur = _a.onBlur;\n return (React.createElement(React.Fragment, null,\n React.createElement(\"span\", { ref: function (span) { _this._element = span; }, className: classNames('k-input', 'k-datepicker', (_b = {},\n _b[\"k-input-\".concat(kendoThemeMaps.sizeMap[size] || size)] = size,\n _b[\"k-rounded-\".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,\n _b[\"k-input-\".concat(fillMode)] = fillMode,\n _b['k-invalid'] = !isValid,\n _b['k-required'] = _this.required,\n _b['k-disabled'] = _this.props.disabled,\n _b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: onFocus, onBlur: onBlur, onClick: _this.mobileMode ? _this.handleIconClick : undefined },\n React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput, ariaRole: 'combobox', readonly: _this.mobileMode, ariaExpanded: _this.show, ariaControls: _this._popupId }, dateInputProps)),\n React.createElement(_this.toggleButtonComp, { type: \"button\", icon: \"calendar\", svgIcon: calendarIcon, title: toggleButtonTitle, className: \"k-input-button\", rounded: null, onClick: _this.mobileMode ? undefined : _this.handleIconClick, \"aria-label\": toggleButtonTitle, onMouseDown: _this.handleIconMouseDown }),\n !_this.mobileMode && _this.renderPopup()),\n _this.mobileMode && _this.renderAdaptivePopup()));\n }));\n return this.props.label\n ? (React.createElement(PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: datepicker, style: { width: this.props.width } }))\n : datepicker;\n };\n DatePickerWithoutContext.prototype.setShow = function (show) {\n var _a = this.props, onOpen = _a.onOpen, onClose = _a.onClose;\n if (this.show === show) {\n return;\n }\n this.setState({ show: show });\n if (show && onOpen) {\n onOpen.call(undefined, {\n target: this\n });\n }\n if (!show && onClose) {\n onClose.call(undefined, {\n target: this\n });\n }\n };\n DatePickerWithoutContext.prototype.mergeTime = function (value) {\n return this.value && value ? setTime(value, this.value) : value;\n };\n DatePickerWithoutContext.prototype.nextTick = function (f) {\n // XXX: use window.setTimeout due to async focus/blur events in IE, and missing relatedTarget prop.\n // XXX: https://github.com/facebook/react/issues/3751\n // Handles multiple focus events happening at the same time.\n clearTimeout(this.nextTickId);\n this.nextTickId = window.setTimeout(function () { return f(); });\n };\n DatePickerWithoutContext.prototype.calculateMedia = function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n this.setState({ windowWidth: entry.target.clientWidth });\n }\n ;\n };\n ;\n /**\n * @hidden\n */\n DatePickerWithoutContext.displayName = 'DatePicker';\n /**\n * @hidden\n */\n DatePickerWithoutContext.propTypes = {\n className: PropTypes.string,\n defaultShow: PropTypes.bool,\n defaultValue: PropTypes.instanceOf(Date),\n disabled: PropTypes.bool,\n focusedDate: PropTypes.instanceOf(Date),\n format: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n skeleton: PropTypes.string,\n pattern: PropTypes.string,\n date: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n time: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n datetime: PropTypes.oneOf(['short', 'medium', 'long', 'full']),\n era: PropTypes.oneOf(['narrow', 'short', 'long']),\n year: PropTypes.oneOf(['numeric', '2-digit']),\n month: PropTypes.oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),\n day: PropTypes.oneOf(['numeric', '2-digit']),\n weekday: PropTypes.oneOf(['narrow', 'short', 'long']),\n hour: PropTypes.oneOf(['numeric', '2-digit']),\n hour12: PropTypes.bool,\n minute: PropTypes.oneOf(['numeric', '2-digit']),\n second: PropTypes.oneOf(['numeric', '2-digit']),\n timeZoneName: PropTypes.oneOf(['short', 'long'])\n })\n ]),\n formatPlaceholder: PropTypes.oneOfType([\n PropTypes.oneOf(['wide', 'narrow', 'short', 'formatPattern']),\n PropTypes.shape({\n year: PropTypes.string,\n month: PropTypes.string,\n day: PropTypes.string,\n hour: PropTypes.string,\n minute: PropTypes.string,\n second: PropTypes.string\n })\n ]),\n id: PropTypes.string,\n ariaLabelledBy: PropTypes.string,\n ariaDescribedBy: PropTypes.string,\n ariaLabel: PropTypes.string,\n min: PropTypes.instanceOf(Date),\n max: PropTypes.instanceOf(Date),\n name: PropTypes.string,\n popupSettings: PropTypes.shape({\n animate: PropTypes.bool,\n appendTo: PropTypes.any,\n popupClass: PropTypes.string\n }),\n show: PropTypes.bool,\n tabIndex: PropTypes.number,\n title: PropTypes.string,\n value: PropTypes.instanceOf(Date),\n weekNumber: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n validationMessage: PropTypes.string,\n required: PropTypes.bool,\n validate: PropTypes.bool,\n valid: PropTypes.bool,\n size: PropTypes.oneOf([null, 'small', 'medium', 'large']),\n rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),\n fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']),\n adaptive: PropTypes.bool,\n adaptiveTitle: PropTypes.string\n };\n /**\n * @hidden\n */\n DatePickerWithoutContext.defaultProps = {\n defaultShow: false,\n defaultValue: null,\n dateInput: DateInput,\n calendar: Calendar,\n toggleButton: ToggleButton,\n popup: Popup,\n pickerWrap: PickerWrap,\n disabled: false,\n format: 'd',\n max: MAX_DATE,\n min: MIN_DATE,\n popupSettings: {},\n tabIndex: 0,\n weekNumber: false,\n required: false,\n validityStyles: true,\n size: 'medium',\n rounded: 'medium',\n fillMode: 'solid'\n };\n return DatePickerWithoutContext;\n}(React.Component));\nexport { DatePickerWithoutContext };\n/**\n * Represents the PropsContext of the `DatePicker` component.\n * Used for global configuration of all `DatePicker` instances.\n *\n * For more information, refer to the [DateInputs Props Context]({% slug props-context_dateinputs %}) article.\n */\nexport var DatePickerPropsContext = createPropsContext();\n/* eslint-disable @typescript-eslint/no-redeclare */\n/**\n * Represents the KendoReact DatePicker Component.\n *\n * Accepts properties of type [DatePickerProps]({% slug api_dateinputs_datepickerprops %}).\n * Obtaining the `ref` returns an object of type [DatePickerHandle]({% slug api_dateinputs_datepickerhandle %}).\n */\nexport var DatePicker = withPropsContext(DatePickerPropsContext, DatePickerWithoutContext);\nDatePicker.displayName = 'KendoReactDatePicker';\nregisterForLocalization(DatePickerWithoutContext);\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar _a, _b, _c;\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_LEVEL = 'data-keyboardnavlevel';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_SCOPE = 'data-keyboardnavscope';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_HEADER = 'data-keyboardnavheader';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_BODY = 'data-keyboardnavbody';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_ID = 'data-keyboardnavid';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_DATA_ZONE = 'data-keyboardnavzone';\n/**\n * @hidden\n */\nexport var KEYBOARD_NAV_FILTER_COL_SUFFIX = '_filter';\nvar FOCUSABLE_ELEMENTS_BASE = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]'\n];\n/**\n * @hidden\n */\nexport var FOCUSABLE_ELEMENTS = __spreadArray(__spreadArray([], FOCUSABLE_ELEMENTS_BASE, true), ['[tabindex]'], false);\n/**\n * @hidden\n */\nexport var TABBABLE_ELEMENTS = __spreadArray(__spreadArray([], FOCUSABLE_ELEMENTS_BASE, true), ['[tabindex]'], false).map(function (selector) { return selector + ':not([tabindex=\"-1\"])'; });\n/**\n * @hidden\n */\nexport var tableKeyboardNavigationScopeAttributes = (_a = {},\n _a[KEYBOARD_NAV_DATA_SCOPE] = true,\n _a);\n/**\n * @hidden\n */\nexport var tableKeyboardNavigationHeaderAttributes = (_b = {},\n _b[KEYBOARD_NAV_DATA_HEADER] = true,\n _b);\n/**\n * @hidden\n */\nexport var tableKeyboardNavigationBodyAttributes = (_c = {},\n _c[KEYBOARD_NAV_DATA_BODY] = true,\n _c);\n","import * as React from 'react';\n/**\n * @hidden\n */\nexport var TableKeyboardNavigationContext = React.createContext(undefined);\nTableKeyboardNavigationContext.displayName = 'KendoReactTableKeyboardNavigationContext';\n","import * as React from 'react';\nimport { KEYBOARD_NAV_DATA_ID, KEYBOARD_NAV_DATA_LEVEL } from './constants';\nimport { TableKeyboardNavigationContext } from './TableKeyboardNavigationContext';\n/**\n * @hidden\n */\nexport var useTableKeyboardNavigation = function (elementId, navigatable) {\n var _a;\n var navigationContext = React.useContext(TableKeyboardNavigationContext);\n if (!navigationContext || !elementId || navigatable === false) {\n return {};\n }\n return _a = {\n tabIndex: navigationContext && navigationContext.activeId && navigationContext.activeId === elementId ? 0 : -1\n },\n _a[KEYBOARD_NAV_DATA_LEVEL] = navigationContext.level,\n _a[KEYBOARD_NAV_DATA_ID] = elementId,\n _a;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { useTableKeyboardNavigation } from '../navigation/hooks';\n/**\n * @hidden\n */\nexport var HeaderThElement = function (props) {\n var ariaSort = props.ariaSort, colSpan = props.colSpan, rowSpan = props.rowSpan, className = props.className, style = props.style, columnId = props.columnId, onKeyDown = props.onKeyDown, navigatable = props.navigatable, ariaColumnIndex = props.ariaColumnIndex, ariaLabel = props.ariaLabel, role = props.role, ariaSelected = props.ariaSelected;\n var navigationAttributes = useTableKeyboardNavigation(columnId, navigatable);\n return (React.createElement(\"th\", __assign({ \"aria-sort\": ariaSort, \"aria-label\": ariaLabel, \"aria-colindex\": ariaColumnIndex, \"aria-selected\": ariaSelected, \n // TODO: Enable this with React 18. Currently throws warnings\n // aria-description={ariaDescription}\n colSpan: colSpan, rowSpan: rowSpan, className: className, style: style, onKeyDown: onKeyDown, role: role }, navigationAttributes), props.children));\n};\nHeaderThElement.displayName = 'KendoReactHeaderThElement';\n","import { FOCUSABLE_ELEMENTS, KEYBOARD_NAV_DATA_BODY, KEYBOARD_NAV_DATA_HEADER, KEYBOARD_NAV_DATA_ID, KEYBOARD_NAV_DATA_LEVEL, KEYBOARD_NAV_DATA_SCOPE, KEYBOARD_NAV_FILTER_COL_SUFFIX, TABBABLE_ELEMENTS } from './constants';\n/**\n * @hidden\n */\nexport var generateNavigatableId = function (navigationId, idPrefix, type) {\n if (type === void 0) { type = 'cell'; }\n return \"\".concat(idPrefix, \"_\").concat(navigationId, \"_\").concat(type);\n};\n/**\n * @hidden\n */\nexport var getNavigatableLevel = function (element) {\n if (!element) {\n return;\n }\n return parseInt(element.getAttribute(KEYBOARD_NAV_DATA_LEVEL) || '', 10);\n};\n/**\n * @hidden\n */\nexport var getNavigatableId = function (element) {\n if (!element) {\n return;\n }\n var dataId = element.getAttribute(KEYBOARD_NAV_DATA_ID);\n return dataId ? dataId : undefined;\n};\n/**\n * @hidden\n */\nexport var isNavigatable = function (element) {\n if (!element) {\n return false;\n }\n var dataId = element.getAttribute(KEYBOARD_NAV_DATA_ID);\n return Boolean(dataId);\n};\n/**\n * @hidden\n */\nexport var getNavigatableElement = function (scope, options) {\n if (options === void 0) { options = { level: 0 }; }\n return scope.querySelector(\"[\".concat(KEYBOARD_NAV_DATA_LEVEL, \"='\").concat(options.level, \"']\"));\n};\n/**\n * @hidden\n */\nexport var getClosestNavigatableElement = function (target) {\n return (target.parentElement &&\n target.parentElement.closest(\"[\".concat(KEYBOARD_NAV_DATA_LEVEL, \"]\")));\n};\n/**\n * @hidden\n */\nexport var getActiveElement = function (scope, activeId) {\n return scope.querySelector(\"[\".concat(KEYBOARD_NAV_DATA_ID, \"='\").concat(activeId, \"']\"));\n};\n/**\n * @hidden\n */\nexport var getClosestScope = function (target) {\n return (target.parentElement &&\n target.parentElement.closest(\"[\".concat(KEYBOARD_NAV_DATA_SCOPE, \"]\")));\n};\n/**\n * @hidden\n */\nexport var getHeaderElement = function (scope) {\n return scope.querySelector(\"[\".concat(KEYBOARD_NAV_DATA_HEADER, \"]\"));\n};\n/**\n * @hidden\n */\nexport var getBodyElement = function (scope) {\n return scope.querySelector(\"[\".concat(KEYBOARD_NAV_DATA_BODY, \"]\"));\n};\n/**\n * @hidden\n */\nexport var getFocusableElements = function (scope, options) {\n if (options === void 0) { options = { focusable: false }; }\n var selectors = options.focusable ? FOCUSABLE_ELEMENTS : TABBABLE_ELEMENTS;\n return Array.from(scope.querySelectorAll(selectors.join(',')));\n};\n/**\n * @hidden\n */\nexport var getNavigatableElements = function (scope, options) {\n if (options === void 0) { options = { level: 0 }; }\n if (!scope) {\n return [];\n }\n var selector = FOCUSABLE_ELEMENTS.map(function (el) { return el + \"[\".concat(KEYBOARD_NAV_DATA_LEVEL, \"='\").concat(options.level, \"']\"); }).join(',');\n return Array.from(scope.querySelectorAll(selector));\n};\n/**\n * @hidden\n */\nexport var filterNavigatableElements = function (options) {\n if (options === void 0) { options = { level: 0 }; }\n var selector = FOCUSABLE_ELEMENTS.map(function (sel) { return sel + \"[\".concat(KEYBOARD_NAV_DATA_LEVEL, \"='\").concat(options.level, \"']\"); }).join(',');\n return function (element) { return element.matches(selector); };\n};\n/**\n * @hidden\n */\nexport var focusElement = function (options) {\n var elementForFocus = options.elementForFocus, event = options.event, contextStateRef = options.contextStateRef, prevElement = options.prevElement;\n if (contextStateRef.current && elementForFocus && elementForFocus.focus) {\n event.preventDefault();\n elementForFocus.focus();\n if (isNavigatable(elementForFocus)) {\n elementForFocus.setAttribute('tabIndex', '0');\n contextStateRef.current.activeId = getNavigatableId(elementForFocus);\n }\n if (prevElement && isNavigatable(prevElement)) {\n prevElement.setAttribute('tabIndex', '-1');\n }\n }\n};\n/**\n * @hidden\n */\nexport var getIdPrefix = function (navigationStateRef) {\n return navigationStateRef.current ? navigationStateRef.current.idPrefix : '';\n};\n/**\n * @hidden\n */\nexport var findNextIdByRowIndex = function (initialRowIndex, cellIndex, elementId, matrix, isReverse) {\n if (!elementId) {\n return [];\n }\n var currentRowIndex = initialRowIndex + (isReverse ? -1 : 1);\n while (currentRowIndex >= 0 && currentRowIndex < matrix.length) {\n var currentId = matrix[currentRowIndex][cellIndex];\n if (currentId !== elementId) {\n return [currentId, [currentRowIndex, cellIndex]];\n }\n currentRowIndex = currentRowIndex + (isReverse ? -1 : 1);\n }\n return [];\n};\n/**\n * @hidden\n */\nexport var findNextIdByCellIndex = function (rowIndex, initialCellIndex, elementId, matrix, isReverse) {\n if (!elementId) {\n return [];\n }\n var currentCellIndex = initialCellIndex + (isReverse ? -1 : 1);\n while (currentCellIndex >= 0 && currentCellIndex < matrix[rowIndex].length) {\n var currentId = matrix[rowIndex][currentCellIndex];\n if (currentId !== elementId) {\n return [currentId, [rowIndex, currentCellIndex]];\n }\n currentCellIndex = currentCellIndex + (isReverse ? -1 : 1);\n }\n return [];\n};\n/**\n * @hidden\n */\nexport var findId = function (navigationMatrix, cellId) {\n if (!cellId) {\n return;\n }\n for (var rowIndex = 0; rowIndex < navigationMatrix.length; rowIndex++) {\n for (var cellIndex = 0; cellIndex < navigationMatrix[rowIndex].length; cellIndex++) {\n if (navigationMatrix[rowIndex][cellIndex] === cellId) {\n return [rowIndex, cellIndex];\n }\n }\n }\n};\n/**\n * @hidden\n */\nexport var getNextNavigationIndex = function (navigationStateRef) {\n return navigationStateRef.current ? navigationStateRef.current.navigationMatrix.length : 0;\n};\n/**\n * @hidden\n */\nexport var getFilterColumnId = function (columnId) {\n return columnId ? \"\".concat(columnId).concat(KEYBOARD_NAV_FILTER_COL_SUFFIX) : '';\n};\n/**\n * @hidden\n */\nexport var tableKeyboardNavigationTools = {\n generateNavigatableId: generateNavigatableId,\n getNavigatableId: getNavigatableId,\n getNavigatableLevel: getNavigatableLevel,\n getNavigatableElement: getNavigatableElement,\n getClosestNavigatableElement: getClosestNavigatableElement,\n getActiveElement: getActiveElement,\n getClosestScope: getClosestScope,\n getHeaderElement: getHeaderElement,\n getBodyElement: getBodyElement,\n getFocusableElements: getFocusableElements,\n getNavigatableElements: getNavigatableElements,\n filterNavigatableElements: filterNavigatableElements,\n focusElement: focusElement,\n getIdPrefix: getIdPrefix,\n isNavigatable: isNavigatable,\n findNextIdByRowIndex: findNextIdByRowIndex,\n findNextIdByCellIndex: findNextIdByCellIndex,\n findId: findId,\n getNextNavigationIndex: getNextNavigationIndex,\n getFilterColumnId: getFilterColumnId\n};\n","import { generateNavigatableId } from '../../navigation/utils';\nimport { ColumnDefaultProps } from '../ColumnProps';\n/**\n * @hidden\n */\nexport function nextColumn(columns, current) {\n var currentDepth = columns[current].depth;\n var next = null;\n for (var index = current + 1; index < columns.length; index++) {\n if (columns[index].depth === currentDepth) {\n next = columns[index];\n break;\n }\n }\n return next;\n}\nvar getColumnWidth = function (column) {\n var width = column.width ? parseFloat(column.width.toString()) : 0;\n if (!width && column.children && column.children.length) {\n width = column.children.reduce(function (currentSum, child) { return getColumnWidth(child) + currentSum; }, 0);\n }\n return width;\n};\n/**\n * @hidden\n */\nexport function mapColumns(columns) {\n var columnsMap = [[]];\n var maxDepth = 0;\n // set colspans, get maxdepth\n for (var q = columns.length - 1; q >= 0; q--) {\n maxDepth = Math.max(maxDepth, columns[q].depth);\n columns[q].colSpan = columns[q].colSpan || 1;\n if (columns[q].parentIndex !== -1) {\n columns[columns[q].parentIndex].colSpan =\n (columns[columns[q].parentIndex].colSpan || 0) + columns[q].colSpan;\n }\n }\n var colIndexByLevel = [];\n var rowSpan = 1;\n // set rowspan, kFirst, index AND create columnsMap\n columns.forEach(function (column, i) {\n columnsMap[column.depth] = columnsMap[column.depth] || [];\n var needKFirst = false;\n if (columnsMap[column.depth].length === 0) {\n if (rowSpan <= 1) {\n rowSpan = 1 + (column.children.length > 0 ? 0 : maxDepth - column.depth);\n }\n else {\n rowSpan--;\n needKFirst = true;\n }\n }\n column.rowSpan = 1 + (column.children.length > 0 ? 0 : maxDepth - column.depth);\n column.kFirst = needKFirst;\n column.index = columnsMap[column.depth].length;\n columnsMap[column.depth].push(i);\n column.ariaColumnIndex = colIndexByLevel[column.depth] ? colIndexByLevel[column.depth] + 1 : 1;\n for (var ci = column.depth; ci < column.depth + column.rowSpan; ci++) {\n colIndexByLevel[ci] = (colIndexByLevel[ci] || 0) + column.colSpan;\n }\n });\n updateLeft(columnsMap, columns);\n updateRight(columnsMap, columns);\n return columnsMap;\n}\n/**\n * @hidden\n */\nexport function updateLeft(columnsMap, columns, generateLeft) {\n var stickyLeftWidth = new Array(columnsMap.length).fill(0);\n var width = 0;\n // set left AND create stickyLeftWidth\n columns.forEach(function (column) {\n if (column.locked && (!column.left || generateLeft)) {\n column.left = stickyLeftWidth[column.depth];\n width = getColumnWidth(column);\n if (column.children.length === 0) {\n for (var i = column.depth; i < stickyLeftWidth.length; i++) {\n stickyLeftWidth[i] += width;\n }\n }\n else {\n stickyLeftWidth[column.depth] += width;\n }\n }\n });\n}\n/**\n * @hidden\n */\nexport function updateRight(columnsMap, columns, generateRight) {\n var width = 0;\n var stickyRightWidth = new Array(columnsMap.length).fill(0);\n // set right, rightBorder AND create stickyRightWidth\n for (var i = columns.length - 1; i >= 0; i--) {\n var column = columns[i];\n if (column.locked && (!column.right || generateRight)) {\n column.right = stickyRightWidth[column.depth];\n width = getColumnWidth(column);\n if (column.children.length === 0) {\n for (var j = column.depth; j < stickyRightWidth.length; j++) {\n stickyRightWidth[j] += width;\n }\n }\n else {\n stickyRightWidth[column.depth] += width;\n }\n var next = nextColumn(columns, i);\n column.rightBorder = !(next && next.locked);\n }\n }\n}\n/**\n * @hidden\n */\nexport function readColumns(elements, idInfo, depth) {\n if (depth === void 0) { depth = 0; }\n var columns = [];\n if (!elements || !elements.length) {\n return [];\n }\n elements.forEach(function (columnProps) {\n var children = readColumns(columnProps.children || [], idInfo, depth + 1);\n columns.push(Object.assign({}, { depth: depth }, ColumnDefaultProps, columnProps, {\n id: columnProps.id ? columnProps.id : generateNavigatableId(\"\".concat(idInfo.prevId++), idInfo.idPrefix, 'column'),\n declarationIndex: columns.length,\n children: children,\n rowSpan: 0,\n colSpan: 0,\n isAccessible: true\n }));\n });\n var comparator = function (a, b) {\n return a.orderIndex === b.orderIndex ?\n a.declarationIndex - b.declarationIndex :\n ((a.orderIndex || 0) - (b.orderIndex || 0));\n };\n columns.sort(comparator);\n if (depth === 0) {\n var ret_1 = [];\n var flat_1 = function (cols, pIndex) {\n return cols.forEach(function (c) {\n c.parentIndex = pIndex;\n flat_1(c.children, ret_1.push(c) - 1);\n });\n };\n flat_1(columns, -1);\n return ret_1;\n }\n return columns;\n}\n/**\n * @hidden\n */\nexport function isRtl(element) {\n return Boolean(element && getComputedStyle(element).direction === 'rtl');\n}\n/**\n * @hidden\n */\nexport function getIndex(event, parent) {\n if (!parent || !event || !event.originalEvent) {\n return -1;\n }\n var coord = { x: event.clientX, y: event.originalEvent.clientY };\n var target = parent.ownerDocument ? parent.ownerDocument.elementFromPoint(coord.x, coord.y) : null;\n while (target && target.parentElement !== parent) {\n target = target.parentElement;\n }\n if (!target && parent.matches('tr')) {\n // parent.ownerDocument.elementFromPoint did not return correct element in grid is in shadow root.\n var predicate = function (c) {\n var pos = c.getBoundingClientRect();\n return coord.x > pos.left && coord.x < pos.left + pos.width && coord.y > pos.top && coord.y < pos.top + pos.height;\n };\n target = Array.from(parent.children).find(predicate) || null;\n }\n var children = parent.children;\n for (var i = 0; i < children.length; i++) {\n if (children[i] === target) {\n return i;\n }\n }\n return -1;\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { Draggable } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar ColumnResizer = /** @class */ (function (_super) {\n __extends(ColumnResizer, _super);\n function ColumnResizer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.draggable = null;\n _this.isDragged = false;\n /**\n * @hidden\n */\n _this.onDrag = function (data) {\n _this.isDragged = true;\n var element = _this.draggable && _this.draggable.element;\n if (element) {\n _this.props.resize(data.event, element, false);\n }\n };\n /**\n * @hidden\n */\n _this.onRelease = function (data) {\n if (!_this.isDragged) {\n return;\n }\n var element = _this.draggable && _this.draggable.element;\n if (element) {\n _this.props.resize(data.event, element, true);\n }\n _this.isDragged = false;\n };\n /**\n * @hidden\n */\n _this.onDoubleClick = function (event) {\n if (_this.isDragged) {\n return;\n }\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.autofit) {\n _this.props.autofit(event, element);\n }\n };\n return _this;\n }\n ColumnResizer.prototype.render = function () {\n var _this = this;\n return (React.createElement(Draggable, { onPress: function (e) { e.event.originalEvent.stopPropagation(); }, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { _this.draggable = component; } },\n React.createElement(\"span\", { className: \"k-column-resizer\", style: { touchAction: 'none' }, draggable: false, onDoubleClick: this.onDoubleClick })));\n };\n return ColumnResizer;\n}(React.Component));\nexport { ColumnResizer };\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * @hidden\n */\nexport function tableColumnsVirtualization(args) {\n var enabled = args.enabled, _a = args.columns, columns = _a === void 0 ? [] : _a, tableViewPortWidth = args.tableViewPortWidth, scrollLeft = args.scrollLeft;\n var colSpans = columns.map(function () { return 1; });\n var hiddenColumns = columns.map(function () { return false; });\n if (!enabled) {\n return { colSpans: colSpans, hiddenColumns: hiddenColumns };\n }\n var widths = columns.map(function (c) { return parseFloat((c.width || '').toString()) || 10; });\n var widthOfHiddenColumns = 0;\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].locked) {\n continue;\n }\n var considerNext = (i < widths.length - 1) ? widths[i + 1] : 0;\n if (widthOfHiddenColumns + widths[i] + considerNext < scrollLeft) {\n hiddenColumns[i] = true;\n widthOfHiddenColumns += widths[i];\n }\n else {\n break;\n }\n }\n var totalWidth = widths.reduce(function (acc, current) { return acc + current; }, 0);\n widthOfHiddenColumns = 0;\n for (var i = columns.length - 1; i >= 0; i--) {\n if (columns[i].locked) {\n continue;\n }\n if (widthOfHiddenColumns + 2 * widths[i] < totalWidth - tableViewPortWidth - scrollLeft) {\n hiddenColumns[i] = true;\n widthOfHiddenColumns += widths[i];\n }\n else {\n break;\n }\n }\n var hiddenCols = __spreadArray([], hiddenColumns, true);\n var hidden = function (value) { return value; };\n var lastVisible = hiddenCols.lastIndexOf(false);\n var anyHidden = hiddenCols.some(hidden);\n var allHidden = hiddenCols.every(hidden);\n var hiddenSeqLength;\n var updateIndex;\n while (anyHidden && hiddenCols.length && (lastVisible !== -1 || allHidden)) {\n if (lastVisible < hiddenCols.length - 1) {\n hiddenSeqLength = allHidden ? hiddenCols.length : hiddenCols.length - lastVisible - 1;\n updateIndex = hiddenCols.length - hiddenSeqLength;\n if (updateIndex === 0) {\n updateIndex = hiddenSeqLength - 1;\n }\n hiddenColumns[updateIndex] = false;\n colSpans[updateIndex] = hiddenSeqLength;\n hiddenCols.splice(lastVisible + 1, hiddenSeqLength);\n }\n while (hiddenCols.length && !hiddenCols[hiddenCols.length - 1]) {\n hiddenCols.pop();\n }\n lastVisible = hiddenCols.lastIndexOf(false);\n anyHidden = hiddenCols.some(hidden);\n allHidden = hiddenCols.every(hidden);\n }\n return { colSpans: colSpans, hiddenColumns: hiddenColumns };\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { canUseDOM, IconWrap } from '@progress/kendo-react-common';\nimport { cancelIcon, plusIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nvar DragClue = /** @class */ (function (_super) {\n __extends(DragClue, _super);\n function DragClue(props) {\n var _this = _super.call(this, props) || this;\n _this.elementRef = React.createRef();\n _this.state = {\n visible: false,\n top: 0,\n left: 0,\n innerText: '',\n status: 'k-i-cancel'\n };\n _this.hiddenElementRef = React.createRef();\n return _this;\n }\n Object.defineProperty(DragClue.prototype, \"element\", {\n get: function () {\n return this.elementRef.current;\n },\n enumerable: false,\n configurable: true\n });\n DragClue.prototype.render = function () {\n var hiddenElement = this.hiddenElementRef.current;\n var status = this.state.status;\n var dragClue = this.state.visible && canUseDOM && createPortal((React.createElement(\"div\", { ref: this.elementRef, className: \"k-header k-drag-clue\", style: {\n display: 'block',\n position: 'absolute',\n zIndex: 20000,\n padding: '8px 12px',\n top: this.state.top + 'px',\n left: this.state.left + 'px'\n } },\n React.createElement(IconWrap, { className: 'k-drag-status', name: status, icon: status === 'k-i-cancel' ? cancelIcon : plusIcon }),\n this.state.innerText)), (hiddenElement && hiddenElement.ownerDocument ?\n hiddenElement.ownerDocument.body :\n document.body));\n return (React.createElement(React.Fragment, null,\n dragClue,\n React.createElement(\"div\", { ref: this.hiddenElementRef, style: { display: 'none' } })));\n };\n return DragClue;\n}(React.PureComponent));\nexport { DragClue };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { canUseDOM } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar DropClue = /** @class */ (function (_super) {\n __extends(DropClue, _super);\n function DropClue(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n height: 0,\n visible: false,\n left: 0,\n top: 0\n };\n _this.hiddenElementRef = React.createRef();\n return _this;\n }\n DropClue.prototype.render = function () {\n var hiddenElement = this.hiddenElementRef.current;\n var dropClue = this.state.visible && canUseDOM && createPortal((React.createElement(\"div\", { className: \"k-grouping-dropclue\", style: {\n zIndex: 10000,\n display: 'block',\n top: this.state.top + 'px',\n left: this.state.left + 'px',\n height: this.state.height + 'px'\n } })), (hiddenElement && hiddenElement.ownerDocument ?\n hiddenElement.ownerDocument.body :\n document.body));\n return (React.createElement(React.Fragment, null,\n dropClue,\n React.createElement(\"div\", { ref: this.hiddenElementRef, style: { display: 'none' } })));\n };\n return DropClue;\n}(React.PureComponent));\nexport { DropClue };\n","/**\n * @hidden\n */\nexport var isPresent = function (value) { return value !== null && value !== undefined; };\n/**\n * @hidden\n */\nexport var isBlank = function (value) { return value === null || value === undefined; };\n/**\n * @hidden\n */\nexport var isArray = function (value) { return Array.isArray(value); };\n/**\n * @hidden\n */\nexport var isFunction = function (value) { return typeof value === 'function'; };\n/**\n * @hidden\n */\nexport var isString = function (value) { return typeof value === 'string'; };\n/**\n * @hidden\n */\nexport var isTruthy = function (value) { return !!value; };\n/**\n * @hidden\n */\nexport var isNullOrEmptyString = function (value) { return isBlank(value) || value.trim().length === 0; };\n/**\n * @hidden\n */\nexport var isNotNullOrEmptyString = function (value) { return !isNullOrEmptyString(value); };\n/**\n * @hidden\n */\nexport var isNumeric = function (value) { return !isNaN(value - parseFloat(value)); };\n/**\n * @hidden\n */\nexport var isDate = function (value) { return value && value.getTime; };\n","import { isPresent } from '../utils';\n// tslint:enable:max-line-length\n/**\n * @hidden\n * Type guard for `CompositeFilterDescriptor`.\n */\nexport var isCompositeFilterDescriptor = function (source) {\n return isPresent(source.filters);\n};\n","/**\n * @hidden\n */\nexport var ifElse = function (predicate, right, left) { return function (value) { return predicate(value) ? right(value) : left(value); }; };\n/**\n * @hidden\n * Performs the right-to-left function composition. Functions should have a unary.\n */\nexport var compose = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return function (data) { return args.reduceRight(function (acc, curr) { return curr(acc); }, data); };\n};\n/**\n * @hidden\n */\nexport var constant = function (x) { return function () { return x; }; };\n/**\n * @hidden\n */\nexport var identity = function (x) { return x; };\n","import { __makeTemplateObject } from \"tslib\";\nimport { isString, isDate } from './utils';\n/**\n * @hidden\n * Creates a single arity function which wraps the value based on the provided predicate.\n * @example\n * ```\n * wrapIf(() => ignoreCase) `tolower(${field})`\n * //ignoreCase=true -> tolower(${field})`\n * //ignoreCase=false -> ${field}`\n * ```\n */\nexport var wrapIf = function (predicate) { return function (str) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return predicate() ? \"\".concat(str[0]).concat(args[0]).concat(str[1]) : args[0];\n}; };\n/**\n * @hidden\n */\nexport var toUTC = function (date) {\n return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n};\n/**\n * @hidden\n */\nexport var quote = function (_a) {\n var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;\n return ({\n value: \"'\".concat(value.replace(/'/g, \"''\"), \"'\"),\n field: field,\n ignoreCase: ignoreCase,\n operator: operator\n });\n};\n/**\n * @hidden\n */\nexport var encodeValue = function (_a) {\n var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;\n return ({\n value: \"\".concat(encodeURIComponent(value)),\n field: field,\n ignoreCase: ignoreCase,\n operator: operator\n });\n};\n/**\n * @hidden\n */\nexport var toLower = function (_a) {\n var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;\n return ({\n field: wrapIf(function () { return ignoreCase; })(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"tolower(\", \")\"], [\"tolower(\", \")\"])), field),\n value: value,\n ignoreCase: ignoreCase,\n operator: operator\n });\n};\n/**\n * @hidden\n */\nexport var normalizeField = function (_a) {\n var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;\n return ({\n value: value,\n field: field.replace(/\\./g, \"/\"),\n ignoreCase: ignoreCase,\n operator: operator\n });\n};\n/**\n * @hidden\n */\nexport var isStringValue = function (x) { return isString(x.value); };\n/**\n * @hidden\n */\nexport var isDateValue = function (x) { return isDate(x.value); };\n/**\n * @hidden\n */\nexport var serializeFilters = function (map, join) { return function (filter) {\n var brackets = wrapIf(function () { return filter.filters.length > 1; });\n return brackets(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"(\", \")\"], [\"(\", \")\"])), filter.filters\n .map(map)\n .join(join(filter)));\n}; };\nvar templateObject_1, templateObject_2;\n","import { isPresent, isString, isArray } from '../utils';\nimport { isCompositeFilterDescriptor } from './filter-descriptor.interface';\nvar operatorMap = function (key) { return ({\n \"!=\": \"neq\",\n \"<\": \"lt\",\n \"<=\": \"lte\",\n \"==\": \"eq\",\n \">\": \"gt\",\n \">=\": \"gte\",\n equal: \"eq\",\n equals: \"eq\",\n equalto: \"eq\",\n ge: \"gte\",\n greater: \"gt\",\n greaterthan: \"gt\",\n greaterthanequal: \"gte\",\n isempty: \"isempty\",\n isequalto: \"eq\",\n isgreaterthan: \"gt\",\n isgreaterthanorequalto: \"gte\",\n islessthan: \"lt\",\n islessthanorequalto: \"lte\",\n isnotempty: \"isnotempty\",\n isnotequalto: \"neq\",\n isnull: \"isnull\",\n le: \"lte\",\n less: \"lt\",\n lessthan: \"lt\",\n lessthanequal: \"lte\",\n ne: \"neq\",\n notequal: \"neq\",\n notequals: \"neq\",\n notequalto: \"neq\",\n notsubstringof: \"doesnotcontain\"\n}[key.toLowerCase()] || key); };\nvar normalizeOperator = function (descriptor) {\n if (descriptor.filters) {\n descriptor.filters = descriptor.filters.map(function (filter) {\n var result = Object.assign({}, filter);\n if (!isCompositeFilterDescriptor(filter) && isString(filter.operator)) {\n result.operator = operatorMap(filter.operator);\n }\n if (isCompositeFilterDescriptor(filter)) {\n normalizeOperator(result);\n }\n return result;\n });\n }\n};\nvar normalizeDescriptor = function (descriptor) {\n if (!isCompositeFilterDescriptor(descriptor)) {\n return {\n filters: isArray(descriptor) ? descriptor : [descriptor],\n logic: \"and\"\n };\n }\n return Object.assign({}, descriptor);\n};\n// tslint:disable:max-line-length\n/**\n * Converts a [`FilterDescriptor`]({% slug api_kendo-data-query_filterdescriptor %}) into a [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}). If a `CompositeFilterDescriptor` is passed, no modifications will be made.\n *\n * @param {CompositeFilterDescriptor | FilterDescriptor} descriptor - The descriptor that will be normalized.\n * @returns {CompositeFilterDescriptor} - The normalized descriptor.\n */\n// tslint:enable:max-line-length\nexport var normalizeFilters = function (descriptor) {\n if (isPresent(descriptor)) {\n descriptor = normalizeDescriptor(descriptor);\n normalizeOperator(descriptor);\n }\n return descriptor;\n};\n","import { isPresent } from './utils';\nvar getterCache = {};\nvar FIELD_REGEX = /\\[(?:(\\d+)|['\"](.*?)['\"])\\]|((?:(?!\\[.*?\\]|\\.).)+)/g;\n// tslint:disable-next-line:no-string-literal\ngetterCache['undefined'] = function (obj) { return obj; };\n/**\n * @hidden\n */\nexport var getter = function (field, safe) {\n var key = field + safe;\n if (getterCache[key]) {\n return getterCache[key];\n }\n var fields = [];\n field.replace(FIELD_REGEX, function (_, index, indexAccessor, field) {\n fields.push(isPresent(index) ? index : (indexAccessor || field));\n return undefined;\n });\n getterCache[key] = function (obj) {\n var result = obj;\n for (var idx = 0; idx < fields.length; idx++) {\n result = result[fields[idx]];\n if (!isPresent(result) && safe) {\n return result;\n }\n }\n return result;\n };\n return getterCache[key];\n};\n","import { __assign, __spreadArray } from \"tslib\";\nimport { isCompositeFilterDescriptor } from '../filtering/filter-descriptor.interface';\nimport { isPresent, isNotNullOrEmptyString, isArray } from '../utils';\nimport { getter } from '../accessor';\nimport { compose, ifElse, identity } from '../funcs';\nimport { isStringValue, isDateValue, quote, serializeFilters, toUTC, encodeValue } from '../filter-serialization.common';\nvar toQueryString = function (values) { return values.reduce(function (acc, _a) {\n var key = _a[0], value = _a[1];\n return __spreadArray(__spreadArray([], acc, true), [\"\".concat(key, \"=\").concat(value)], false);\n}, []); };\nvar toObject = function (values) { return values.reduce(function (acc, _a) {\n var _b;\n var key = _a[0], value = _a[1];\n return (__assign(__assign({}, acc), (_b = {}, _b[key] = value, _b)));\n}, {}); };\nvar pairwise = function (key) { return function (value) { return [key, value]; }; };\nvar empty = function () { return null; };\nvar isNotEmptyArray = function (value) { return isPresent(value) && isArray(value) && value.length > 0; };\nvar has = function (accessor) { return function (value) { return isPresent(accessor(value)); }; };\nvar isNotEmpty = function (accessor) { return function (value) { return isNotEmptyArray(accessor(value)); }; };\nvar runOrEmpty = function (predicate, fn) { return ifElse(predicate, fn, empty); };\nvar calcPage = function (_a) {\n var skip = _a.skip, take = _a.take;\n return Math.floor((skip || 0) / take) + 1;\n};\nvar formatDescriptors = function (accessor, formatter) { return function (state) { return (accessor(state).map(formatter).join(\"~\")); }; };\nvar removeAfter = function (what) { return function (str) { return str.slice(0, str.indexOf(what)); }; };\nvar replace = function (patterns) {\n return compose.apply(void 0, patterns.map(function (_a) {\n var left = _a[0], right = _a[1];\n return function (s) { return s.replace(new RegExp(left, \"g\"), right); };\n }));\n};\nvar sanitizeDateLiterals = replace([[\"\\\"\", \"\"], [\":\", \"-\"]]);\nvar removeAfterDot = removeAfter(\".\");\nvar directionFormatter = function (_a) {\n var field = _a.field, _b = _a.dir, dir = _b === void 0 ? \"asc\" : _b;\n return \"\".concat(field, \"-\").concat(dir);\n};\nvar aggregateFormatter = function (_a) {\n var field = _a.field, aggregate = _a.aggregate;\n return \"\".concat(field, \"-\").concat(aggregate);\n};\nvar take = getter(\"take\");\nvar aggregates = getter(\"aggregates\");\nvar skip = getter(\"skip\");\nvar group = getter(\"group\");\nvar sort = getter(\"sort\", true);\nvar formatSort = formatDescriptors(sort, directionFormatter);\nvar formatGroup = formatDescriptors(group, directionFormatter);\nvar formatAggregates = formatDescriptors(aggregates, aggregateFormatter);\nvar prefixDateValue = function (value) { return \"datetime'\".concat(value, \"'\"); };\nvar formatDateValue = compose(prefixDateValue, removeAfterDot, sanitizeDateLiterals, JSON.stringify, toUTC);\nvar formatDate = function (_a) {\n var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;\n return ({\n value: formatDateValue(value),\n field: field,\n ignoreCase: ignoreCase,\n operator: operator\n });\n};\nvar normalizeSort = function (state) { return Object.assign({}, state, {\n sort: (sort(state) || []).filter(function (_a) {\n var dir = _a.dir;\n return isNotNullOrEmptyString(dir);\n })\n}); };\nvar transformSkip = compose(pairwise('page'), calcPage);\nvar transformTake = compose(pairwise('pageSize'), take);\nvar transformGroup = compose(pairwise('group'), formatGroup);\nvar transformSort = compose(pairwise('sort'), formatSort);\nvar transformAggregates = compose(pairwise('aggregate'), formatAggregates);\nvar serializePage = runOrEmpty(has(skip), transformSkip);\nvar serializePageSize = runOrEmpty(has(take), transformTake);\nvar serializeGroup = runOrEmpty(isNotEmpty(group), transformGroup);\nvar serializeAggregates = runOrEmpty(has(aggregates), transformAggregates);\nvar serializeSort = compose(runOrEmpty(isNotEmpty(sort), transformSort), normalizeSort);\nvar hasField = function (_a) {\n var field = _a.field;\n return isNotNullOrEmptyString(field);\n};\nvar filterFormatter = function (_a) {\n var field = _a.field, operator = _a.operator, value = _a.value;\n return \"\".concat(field, \"~\").concat(operator, \"~\").concat(value);\n};\nvar dateFormatter = ifElse(isDateValue, compose(filterFormatter, formatDate), filterFormatter);\nvar typedFormatter = function (encode) { return runOrEmpty(hasField, ifElse(isStringValue, compose(filterFormatter, quote, encode ? encodeValue : identity), dateFormatter)); };\nvar join = function (_a) {\n var logic = _a.logic;\n return \"~\".concat(logic, \"~\");\n};\nvar serialize = function (encode) { return serializeFilters(function (filter) { return ifElse(isCompositeFilterDescriptor, serialize(encode), typedFormatter(encode))(filter); }, join); };\nvar serializeFilter = function (_a, encode) {\n var filter = _a.filter;\n if (filter && filter.filters) {\n var filters = serialize(encode)(filter);\n if (filters.length) {\n return ['filter', filters];\n }\n }\n return null;\n};\nvar rules = function (state, encode) {\n if (encode === void 0) { encode = true; }\n return function (key) { return ({\n \"aggregates\": serializeAggregates(state),\n \"filter\": serializeFilter(state, encode),\n \"group\": serializeGroup(state),\n \"skip\": serializePage(state),\n \"sort\": serializeSort(state),\n \"take\": serializePageSize(state)\n }[key]); };\n};\n/**\n * Converts a [DataSourceRequestState]({% slug api_kendo-data-query_datasourcerequeststate %}) into a string\n * that is comparable with the `DataSourceRequest` format in UI for ASP.NET MVC.\n *\n * @param {DataSourceRequestState} state - The state that will be serialized.\n * @returns {string} - The serialized state.\n *\n * @example\n * {% platform_content angular %}\n * ```ts\n * import {\n * toDataSourceRequestString,\n * translateDataSourceResultGroups,\n * translateAggregateResults\n * } from '@progress/kendo-data-query';\n *\n * export class Service {\n * private BASE_URL: string = '...';\n *\n * constructor(private http: Http) { }\n *\n * // Omitted for brevity...\n *\n * private fetch(state: DataSourceRequestState): Observable {\n * const queryStr = `${toDataSourceRequestString(state)}`; //serialize the state\n * const hasGroups = state.group && state.group.length;\n *\n * return this.http\n * .get(`${this.BASE_URL}?${queryStr}`) //send the state to the server\n * .map(response => response.json())\n * .map(({Data, Total, AggregateResults}) => // process the response\n * ({\n * //if there are groups convert them to compatible format\n * data: hasGroups ? translateDataSourceResultGroups(Data) : Data,\n * total: Total,\n * // convert the aggregates if such exists\n * aggregateResult: translateAggregateResults(AggregateResults)\n * })\n * );\n * }\n * }\n * ```\n * {% endplatform_content %}\n *\n * {% platform_content react %}\n * ```jsx\n * import React from 'react';\n * import { toDataSourceRequestString, translateDataSourceResultGroups } from '@progress/kendo-data-query';\n *\n * export function withState(WrappedGrid) {\n * return class StatefullGrid extends React.Component {\n * constructor(props) {\n * super(props);\n * this.state = { dataState: { skip: 0, take: 20 } };\n * }\n *\n * render() {\n * return (\n * \n * );\n * }\n *\n * componentDidMount() {\n * this.fetchData(this.state.dataState);\n * }\n *\n * dataStateChange = (changeEvent) => {\n * this.setState({ dataState: changeEvent.data });\n * this.fetchData(changeEvent.data);\n * }\n *\n * fetchData(dataState) {\n * const queryStr = `${toDataSourceRequestString(dataState)}`; // Serialize the state\n * const hasGroups = dataState.group && dataState.group.length;\n *\n * const base_url = 'api/Products';\n * const init = { method: 'GET', accept: 'application/json', headers: {} };\n *\n * fetch(`${base_url}?${queryStr}`, init)\n * .then(response => response.json())\n * .then(({ data, total }) => {\n * this.setState({\n * data: hasGroups ? translateDataSourceResultGroups(data) : data,\n * total,\n * dataState\n * });\n * });\n * }\n * }\n * }\n * ```\n * {% endplatform_content %}\n */\nexport var toDataSourceRequestString = function (state) { return (toQueryString(Object.keys(state)\n .map(rules(state))\n .filter(isPresent)).join('&')); };\n/**\n * Converts a [DataSourceRequestState]({% slug api_kendo-data-query_datasourcerequeststate %}) into an object\n * that is compatible with the `DataSourceRequest` format in UI for ASP.NET MVC.\n *\n * @param {DataSourceRequestState} state - The state that will be serialized.\n * @returns {any} - The serialized state.\n */\nexport var toDataSourceRequest = function (state) { return (toObject(Object.keys(state)\n .map(rules(state, false))\n .filter(isPresent))); };\n","import { isPresent } from '../utils';\nimport { compose } from '../funcs';\n// tslint:enable:max-line-length\nvar set = function (field, target, value) {\n target[field] = value;\n return target;\n};\nvar toCamelCase = function (str) { return str.replace(/(^[A-Z])/g, function (_, g1) { return g1.toLowerCase(); }); };\nvar prop = function (fieldName) { return function (obj) {\n var value = obj[fieldName];\n if (isPresent(value)) {\n return value;\n }\n return obj[toCamelCase(fieldName)];\n}; };\nvar member = prop(\"Member\");\nvar aggregateMethodName = prop(\"AggregateMethodName\");\nvar value = prop(\"Value\");\nvar convert = function (mapper) { return function (values) { return Object.keys(values).reduce(mapper.bind(null, values), {}); }; };\nvar translateAggregate = convert(function (source, acc, field) { return set(field.toLowerCase(), acc, source[field]); });\nvar translateAggregates = convert(function (source, acc, field) { return set(field, acc, translateAggregate(source[field])); });\nvar valueOrDefault = function (value, defaultValue) { return isPresent(value) ? value : defaultValue; };\nvar normalizeGroup = function (group) { return ({\n aggregates: group.Aggregates || group.aggregates,\n field: group.Member || group.member || group.field,\n hasSubgroups: group.HasSubgroups || group.hasSubgroups || false,\n items: group.Items || group.items,\n value: valueOrDefault(group.Key, valueOrDefault(group.key, group.value))\n}); };\nvar translateGroup = compose(function (_a) {\n var field = _a.field, hasSubgroups = _a.hasSubgroups, value = _a.value, aggregates = _a.aggregates, items = _a.items;\n return ({\n aggregates: translateAggregates(aggregates),\n field: field,\n items: hasSubgroups ? items.map(translateGroup) : items,\n value: value\n });\n}, normalizeGroup);\n// tslint:disable:max-line-length\n/**\n * Converts the grouped result, which is returned into the `Data` field of the UI for ASP.NET MVC `ToDataSourceResult` method, to a comparable format.\n * @param data - The value of the `Data` field of the response.\n * @returns {GroupResult[]} - The converted result.\n */\nexport var translateDataSourceResultGroups = function (data) { return data.map(translateGroup); };\n/**\n * Converts the `AggregateResults` field content, which is returned by the UI for ASP.NET MVC `ToDataSourceResult` method, to a comparable format.\n * @param data - The value of the `AggregateResults` field of the response.\n * @returns {AggregateResult} - The converted result.\n */\n// tslint:enable:max-line-length\nexport var translateAggregateResults = function (data) { return ((data || []).reduce(function (acc, x) { return set(member(x), acc, set(aggregateMethodName(x).toLowerCase(), acc[member(x)] || {}, value(x))); }, {})); };\n","import { isCompositeFilterDescriptor } from \"./filter-descriptor.interface\";\nimport { getter } from \"../accessor\";\nimport { isFunction, isPresent, isDate, isString, isBlank } from \"../utils\";\nvar logic = {\n \"or\": {\n concat: function (acc, fn) { return function (a) { return acc(a) || fn(a); }; },\n identity: function () { return false; }\n },\n \"and\": {\n concat: function (acc, fn) { return function (a) { return acc(a) && fn(a); }; },\n identity: function () { return true; }\n }\n};\nvar operatorsMap = {\n contains: function (a, b) { return (a || \"\").indexOf(b) >= 0; },\n doesnotcontain: function (a, b) { return (a || \"\").indexOf(b) === -1; },\n doesnotendwith: function (a, b) { return (a || \"\").indexOf(b, (a || \"\").length - (b || \"\").length) < 0; },\n doesnotstartwith: function (a, b) { return (a || \"\").lastIndexOf(b, 0) === -1; },\n endswith: function (a, b) { return (a || \"\").indexOf(b, (a || \"\").length - (b || \"\").length) >= 0; },\n eq: function (a, b) { return a === b; },\n gt: function (a, b) { return a > b; },\n gte: function (a, b) { return a >= b; },\n isempty: function (a) { return a === ''; },\n isnotempty: function (a) { return a !== ''; },\n isnotnull: function (a) { return isPresent(a); },\n isnull: function (a) { return isBlank(a); },\n lt: function (a, b) { return a < b; },\n lte: function (a, b) { return a <= b; },\n neq: function (a, b) { return a != b; },\n startswith: function (a, b) { return (a || \"\").lastIndexOf(b, 0) === 0; }\n};\nvar dateRegExp = /^\\/Date\\((.*?)\\)\\/$/;\nvar convertValue = function (value, ignoreCase) {\n if (value != null && isString(value)) {\n var date = dateRegExp.exec(value);\n if (date) {\n return new Date(+date[1]).getTime();\n }\n else if (ignoreCase) {\n return value.toLowerCase();\n }\n }\n else if (value != null && isDate(value)) {\n return value.getTime();\n }\n return value;\n};\nvar typedGetter = function (prop, value, ignoreCase) {\n if (!isPresent(value)) {\n return prop;\n }\n var acc = prop;\n if (isString(value)) {\n var date = dateRegExp.exec(value);\n if (date) {\n value = new Date(+date[1]);\n }\n else {\n acc = function (a) {\n var x = prop(a);\n if (x === null) {\n return x;\n }\n var stringValue = typeof x === 'string' ? x : x + \"\";\n return ignoreCase ? stringValue.toLowerCase() : stringValue;\n };\n }\n }\n if (isDate(value)) {\n return function (a) {\n var x = acc(a);\n return isDate(x) ? x.getTime() : x;\n };\n }\n return acc;\n};\nvar transformFilter = function (_a) {\n var field = _a.field, ignoreCase = _a.ignoreCase, value = _a.value, operator = _a.operator;\n field = !isPresent(field) ? function (a) { return a; } : field;\n ignoreCase = isPresent(ignoreCase) ? ignoreCase : true;\n var itemProp = typedGetter(isFunction(field) ? field : getter(field, true), value, ignoreCase);\n value = convertValue(value, ignoreCase);\n var op = isFunction(operator) ? operator : operatorsMap[operator];\n return function (a) { return op(itemProp(a), value, ignoreCase); };\n};\n/**\n * @hidden\n */\nexport var transformCompositeFilter = function (filter) {\n var combiner = logic[filter.logic];\n return filter.filters\n .filter(isPresent)\n .map(function (x) { return isCompositeFilterDescriptor(x) ? transformCompositeFilter(x) : transformFilter(x); })\n .reduce(combiner.concat, combiner.identity);\n};\n","import { isPresent } from '../utils';\nimport { isCompositeFilterDescriptor } from './filter-descriptor.interface';\nimport { normalizeFilters } from './filter.operators';\nimport { transformCompositeFilter } from \"./filter-no-eval\";\n// tslint:disable:max-line-length\n/**\n * Creates a [Predicate]({% slug api_kendo-data-query_predicate %}) function for the specified [CompositeFilterDescriptor]({% slug api_kendo-data-query_compositefilterdescriptor %}).\n *\n * @param {CompositeFilterDescriptor} descriptor - The descriptor for which the predicate is created.\n * @returns {Predicate} - The created function instance.\n *\n * @example\n * ```ts\n * import { compileFilter } from '@progress/kendo-data-query';\n *\n * const data = [{ name: \"Pork\" }, { name: \"Pepper\" }, { name: \"Beef\" } ];\n * const predicate = compileFilter({ logic: \"and\", filters: [{ field: \"name\", operator: \"startswith\", value: \"P\" }] });\n * const result = data.filter(predicate);\n *\n * ```\n */\n// tslint:enable:max-line-length\nexport var compileFilter = function (descriptor) {\n if (!descriptor || descriptor.filters.length === 0) {\n return function () { return true; };\n }\n return transformCompositeFilter(descriptor);\n};\n// tslint:disable:max-line-length\n/**\n * Filters the provided array according to the specified [CompositeFilterDescriptor]({% slug api_kendo-data-query_compositefilterdescriptor %}).\n *\n * @param {T[]} data - The data that will be filtered.\n * @param {(CompositeFilterDescriptor | FilterDescriptor)} descriptor - The filter criteria that will be applied.\n * @returns {T[]} - The filtered data.\n *\n * @example\n * ```ts\n * import { filterBy } from '@progress/kendo-data-query';\n *\n * const data = [\n * { name: \"Pork\", category: \"Food\", subcategory: \"Meat\" },\n * { name: \"Pepper\", category: \"Food\", subcategory: \"Vegetables\" },\n * { name: \"Beef\", category: \"Food\", subcategory: \"Meat\" }\n * ];\n *\n * const result = filterBy(data, {\n * logic: 'and',\n * filters: [\n * { field: \"name\", operator: \"startswith\", value: \"p\", ignoreCase: true },\n * { field: \"subcategory\", operator: \"eq\", value: \"Meat\" },\n * ]\n * });\n *\n * // output:\n * // [{ \"name\": \"Pork\", \"category\": \"Food\", \"subcategory\": \"Meat\" }]\n * ```\n */\n// tslint:enable:max-line-length\nexport var filterBy = function (data, descriptor) {\n if (!isPresent(descriptor) || (isCompositeFilterDescriptor(descriptor) && descriptor.filters.length === 0)) {\n return data;\n }\n return data.filter(compileFilter(normalizeFilters(descriptor)));\n};\n","/**\n * Represents the list of supported [`FilterDescriptor`]({% slug api_kendo-data-query_filterdescriptor %}) operators.\n * Allows restricting `FilterDescriptor.operator` definition to available values only.\n */\nexport var FilterOperator;\n(function (FilterOperator) {\n /**\n * The `contains` operator.\n */\n FilterOperator[\"Contains\"] = \"contains\";\n /**\n * The `doesnotcontain` operator.\n */\n FilterOperator[\"DoesNotContain\"] = \"doesnotcontain\";\n /**\n * The `doesnotendwith` operator.\n */\n FilterOperator[\"DoesNotEndWith\"] = \"doesnotendwith\";\n /**\n * The `doesnotstartwith` operator.\n */\n FilterOperator[\"DoesNotStartWith\"] = \"doesnotstartwith\";\n /**\n * The `endswith` operator.\n */\n FilterOperator[\"EndsWith\"] = \"endswith\";\n /**\n * The `eq` operator.\n */\n FilterOperator[\"EqualTo\"] = \"eq\";\n /**\n * The `gt` operator.\n */\n FilterOperator[\"GreaterThan\"] = \"gt\";\n /**\n * The `gte` operator.\n */\n FilterOperator[\"GreaterThanOrEqual\"] = \"gte\";\n /**\n * The `isempty` operator.\n */\n FilterOperator[\"IsEmpty\"] = \"isempty\";\n /**\n * The `isnotempty` operator.\n */\n FilterOperator[\"IsNotEmpty\"] = \"isnotempty\";\n /**\n * The `isnotnull` operator.\n */\n FilterOperator[\"IsNotNull\"] = \"isnotnull\";\n /**\n * The `isnull` operator.\n */\n FilterOperator[\"IsNull\"] = \"isnull\";\n /**\n * The `lt` operator.\n */\n FilterOperator[\"LessThan\"] = \"lt\";\n /**\n * The `lte` operator.\n */\n FilterOperator[\"LessThanOrEqual\"] = \"lte\";\n /**\n * The `neq` operator.\n */\n FilterOperator[\"NotEqualTo\"] = \"neq\";\n /**\n * The `startswith` operator.\n */\n FilterOperator[\"StartsWith\"] = \"startswith\";\n})(FilterOperator || (FilterOperator = {}));\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { getActiveElement, guid, Keys } from '@progress/kendo-react-common';\nimport { findId, findNextIdByCellIndex, findNextIdByRowIndex, getBodyElement, getHeaderElement, getNavigatableId, tableKeyboardNavigationTools as navigationTools } from './utils';\n/**\n * @hidden\n */\nvar onConstructor = function (options) {\n var navigatable = options.navigatable, contextStateRef = options.contextStateRef, navigationStateRef = options.navigationStateRef, idPrefix = options.idPrefix;\n // v.2: check if nested navigation\n if (navigatable) {\n contextStateRef.current = {\n activeId: '',\n level: 0\n };\n navigationStateRef.current = {\n activeElementIsFocused: false,\n prevNavigationIndexes: undefined,\n idPrefix: idPrefix || guid(),\n navigationMatrix: [],\n lastHeaderIndex: -1\n };\n }\n};\n/**\n * @hidden\n */\nvar onComponentDidMount = function (options) {\n var scope = options.scope, contextStateRef = options.contextStateRef, navigationStateRef = options.navigationStateRef;\n if (contextStateRef.current && navigationStateRef.current && scope) {\n generateMatrix(options);\n var firstId = navigationStateRef.current.navigationMatrix[0][0];\n var firstIdElement = navigationTools.getActiveElement(scope, firstId);\n if (firstId && firstIdElement) {\n contextStateRef.current.activeId = firstId;\n firstIdElement.setAttribute('tabIndex', '0');\n }\n }\n};\n/**\n * @hidden\n */\nvar onGetSnapshotBeforeUpdate = function (options) {\n var contextStateRef = options.contextStateRef, navigationStateRef = options.navigationStateRef, currentDocument = options.document;\n if (contextStateRef.current && navigationStateRef.current && currentDocument) {\n var activeElement = getActiveElement(currentDocument);\n var activeId = navigationTools.getNavigatableId(activeElement);\n if (activeId && activeId === contextStateRef.current.activeId) {\n navigationStateRef.current.activeElementIsFocused = true;\n }\n }\n};\n/**\n * @hidden\n */\nvar onComponentDidUpdate = function (options) {\n var scope = options.scope, contextStateRef = options.contextStateRef, navigationStateRef = options.navigationStateRef;\n generateMatrix(options);\n // check if nested navigation\n if (contextStateRef.current && navigationStateRef.current && scope) {\n var activeElement = navigationTools.getActiveElement(scope, contextStateRef.current.activeId);\n if (!activeElement) {\n var firstId = navigationStateRef.current.navigationMatrix[0][0];\n var firstIdElement = navigationTools.getActiveElement(scope, firstId);\n if (firstId && firstIdElement) {\n contextStateRef.current.activeId = firstId;\n firstIdElement.setAttribute('tabIndex', '0');\n if (navigationStateRef.current.activeElementIsFocused) {\n firstIdElement.focus();\n }\n }\n }\n navigationStateRef.current.activeElementIsFocused = false;\n }\n};\n/**\n * @hidden\n */\nvar onFocus = function (event, options) {\n var contextStateRef = options.contextStateRef;\n if (event.isDefaultPrevented()) {\n return;\n }\n if (!contextStateRef.current) {\n return;\n }\n var focusedElement = event.target;\n var activeId = navigationTools.getNavigatableId(focusedElement);\n if (activeId && activeId !== contextStateRef.current.activeId) {\n var scope = navigationTools.getClosestScope(focusedElement);\n if (!scope) {\n return;\n }\n var prevElement = navigationTools.getActiveElement(scope, contextStateRef.current.activeId);\n if (prevElement) {\n prevElement.setAttribute('tabIndex', '-1');\n }\n focusedElement.setAttribute('tabIndex', '0');\n contextStateRef.current.activeId = activeId;\n }\n};\n/**\n * @hidden\n */\nvar onKeyDown = function (event, options) {\n var contextStateRef = options.contextStateRef, navigationStateRef = options.navigationStateRef, onNavigationAction = options.onNavigationAction;\n if (event.isDefaultPrevented()) {\n return;\n }\n if (!contextStateRef.current || !navigationStateRef.current) {\n return;\n }\n if (event.keyCode === Keys.esc) {\n // activate navigation\n var elementForFocus = navigationTools.getClosestNavigatableElement(event.target);\n navigationTools.focusElement({ elementForFocus: elementForFocus, event: event, contextStateRef: contextStateRef });\n return;\n }\n var element = event.target;\n var elementId = navigationTools.getNavigatableId(element);\n var dataLevel = navigationTools.getNavigatableLevel(element);\n var scope = navigationTools.getClosestScope(element);\n var matrix = navigationStateRef.current.navigationMatrix;\n if (dataLevel !== undefined && scope) {\n if (event.keyCode === Keys.enter) {\n // activate nested navigation or focus focusable element\n var navigatableElement = navigationTools.getNavigatableElement(element, { level: dataLevel + 1 });\n if (navigatableElement) {\n navigationTools.focusElement({\n elementForFocus: navigatableElement,\n event: event,\n contextStateRef: contextStateRef,\n prevElement: element\n });\n return;\n }\n else {\n var elementForFocus = navigationTools.getFocusableElements(element)[0];\n navigationTools.focusElement({ elementForFocus: elementForFocus, event: event, contextStateRef: contextStateRef, prevElement: element });\n return;\n }\n }\n if (event.keyCode === Keys.up ||\n event.keyCode === Keys.down ||\n event.keyCode === Keys.left ||\n event.keyCode === Keys.right) {\n var isReverse = event.keyCode === Keys.up || event.keyCode === Keys.left;\n var isVertical = event.keyCode === Keys.up || event.keyCode === Keys.down;\n var currentIdIndexes = void 0;\n if (navigationStateRef.current && navigationStateRef.current.prevNavigationIndexes) {\n var _a = navigationStateRef.current.prevNavigationIndexes, rowIndex = _a[0], cellIndex = _a[1];\n if (matrix[rowIndex][cellIndex] === elementId) {\n currentIdIndexes = navigationStateRef.current.prevNavigationIndexes;\n }\n else {\n currentIdIndexes = findId(matrix, elementId);\n }\n }\n else {\n currentIdIndexes = findId(matrix, elementId);\n }\n if (currentIdIndexes) {\n var rowIndex = currentIdIndexes[0], cellIndex = currentIdIndexes[1];\n var _b = isVertical ?\n findNextIdByRowIndex(rowIndex, cellIndex, elementId, matrix, isReverse) :\n findNextIdByCellIndex(rowIndex, cellIndex, elementId, matrix, isReverse), idForFocus = _b[0], currentIndexes = _b[1];\n if (idForFocus) {\n var elementForFocus = navigationTools.getActiveElement(scope, idForFocus);\n // emit event\n navigationTools.focusElement({ elementForFocus: elementForFocus, event: event, contextStateRef: contextStateRef, prevElement: element });\n navigationStateRef.current.prevNavigationIndexes = currentIndexes;\n if (onNavigationAction) {\n onNavigationAction({ focusElement: elementForFocus, event: event });\n }\n }\n }\n }\n }\n};\n/**\n * @hidden\n */\nvar generateMatrix = function (options) {\n var navigationStateRef = options.navigationStateRef, scope = options.scope;\n if (!navigationStateRef.current || !scope) {\n return;\n }\n var matrix = [];\n var thead = getHeaderElement(scope);\n var tbody = getBodyElement(scope);\n if (!thead || !tbody) {\n return;\n }\n var headerRows = Array.from(thead.children);\n var bodyRows = Array.from(tbody.children);\n __spreadArray(__spreadArray([], headerRows, true), bodyRows, true).forEach(function (row, rowIndex) {\n Array.from(row.children).forEach(function (cell) {\n var cellId = getNavigatableId(cell);\n if (!cellId) {\n return;\n } // cell is not navigatable\n var rowSpan = cell.rowSpan || 1;\n var cellSpan = cell.colSpan || 1;\n var cellIndex;\n for (var depth = rowIndex, maxDepth = rowIndex + rowSpan; depth < maxDepth; depth++) {\n if (!matrix[depth]) {\n matrix[depth] = [];\n }\n if (cellIndex === undefined) {\n var freeSlotIndex = matrix[depth].findIndex(function (mi) { return !mi; });\n cellIndex = freeSlotIndex > -1 ? freeSlotIndex : matrix[depth].length;\n }\n matrix[depth][cellIndex] = cellId || '';\n }\n for (var depth = cellIndex + 1, maxDepth = cellIndex + cellSpan; depth < maxDepth; depth++) {\n matrix[rowIndex][depth] = cellId || '';\n }\n });\n });\n navigationStateRef.current.navigationMatrix = matrix.filter(function (row) { return !!row; });\n navigationStateRef.current.lastHeaderIndex = headerRows.length - 1;\n};\n/**\n * @hidden\n */\nexport var tableKeyboardNavigation = {\n onConstructor: onConstructor,\n onComponentDidMount: onComponentDidMount,\n onGetSnapshotBeforeUpdate: onGetSnapshotBeforeUpdate,\n onComponentDidUpdate: onComponentDidUpdate,\n onFocus: onFocus,\n onKeyDown: onKeyDown,\n generateMatrix: generateMatrix\n};\n","/** @hidden */\nexport var TABLE_ROW_INDEX_ATTRIBUTE = 'data-grid-row-index';\n/** @hidden */\nexport var TABLE_COL_INDEX_ATTRIBUTE = 'data-grid-col-index';\n/** @hidden */\nexport var TABLE_PREVENT_SELECTION_ELEMENT = 'data-prevent-selection';\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { extendDataItem, getter, Keys, mapTree, hasRelativeStackingContext } from '@progress/kendo-react-common';\nimport { TABLE_COL_INDEX_ATTRIBUTE, TABLE_ROW_INDEX_ATTRIBUTE } from './constants';\nvar GROUP_SUBITEMS_COLLECTION = 'items';\nvar LAST_SELECTION_STATE = {};\nvar getCellSelection = function (currentSelection, selectedColumn) {\n if (!currentSelection || (Array.isArray(currentSelection) && currentSelection.length === 0)) {\n return [selectedColumn];\n }\n else {\n var foundIndex = currentSelection.findIndex(function (columnIndex) { return columnIndex === selectedColumn; });\n if (foundIndex > -1) {\n return currentSelection.filter(function (columnIndex) { return columnIndex !== selectedColumn; });\n }\n else {\n return __spreadArray(__spreadArray([], currentSelection, true), [selectedColumn], false);\n }\n }\n};\n/** @hidden */\nexport var closestTagName = function (target, tagName) {\n var currentTarget = target;\n while (currentTarget) {\n if (currentTarget.tagName === tagName) {\n return currentTarget;\n }\n else if (currentTarget.tagName === 'TABLE') {\n return null;\n }\n currentTarget = currentTarget.parentElement;\n }\n return null;\n};\n/** @hidden */\nexport var getRowIndex = function (element) {\n if (!element) {\n return;\n }\n var rowIndex = element.getAttribute(TABLE_ROW_INDEX_ATTRIBUTE);\n return rowIndex ? parseInt(rowIndex, 10) : undefined;\n};\n/** @hidden */\nexport var getColumnIndex = function (element) {\n if (!element) {\n return;\n }\n var colIndex = element.getAttribute(TABLE_COL_INDEX_ATTRIBUTE);\n return colIndex ? parseInt(colIndex, 10) : undefined;\n};\n/**\n * @hidden\n *\n * Apply the selected field to the data items based on the selected state.\n *\n * @param {{data: any, selectedState: {[id: string]: boolean | number[]}, dataItemKey: string; selectedField: string; subItemsField?: string; }} options\n * @returns {any[]}\n */\nexport var setSelectedState = function (options) {\n var subItemsField = options.subItemsField || GROUP_SUBITEMS_COLLECTION;\n var idGetter = getter(options.dataItemKey);\n return mapTree(options.data, subItemsField, function (item) {\n var _a;\n return extendDataItem(item, subItemsField, (_a = {},\n _a[options.selectedField] = options.selectedState[idGetter(item)],\n _a));\n });\n};\n/**\n * Get selected state from the component KeyDown event.\n *\n * @param {{event: TableKeyDownEvent, selectedState: {[id: string]: boolean | number[]}, dataItemKey: string}} options\n * @returns {{[id: string]: boolean | number[]}} - The new selected state.\n */\nexport var getSelectedStateFromKeyDown = function (options) {\n var event = options.event, dataItemKey = options.dataItemKey, selectedState = options.selectedState;\n var syntheticEvent = event.syntheticEvent, nativeEvent = event.nativeEvent, dataItems = event.dataItems, componentId = event.componentId, mode = event.mode, cell = event.cell, selectedField = event.selectedField;\n var target = nativeEvent.target, ctrlKey = nativeEvent.ctrlKey, metaKey = nativeEvent.metaKey, altKey = nativeEvent.altKey, shiftKey = nativeEvent.shiftKey;\n if (syntheticEvent.isDefaultPrevented() || nativeEvent.keyCode !== Keys.enter) {\n return selectedState;\n }\n var tdElement = closestTagName(target, 'TD');\n var trElement = closestTagName(target, 'TR');\n var colIndex = getColumnIndex(tdElement);\n var rowIndex = getRowIndex(trElement);\n var selectionState = {};\n if (tdElement && trElement && rowIndex !== undefined && colIndex !== undefined) {\n selectionState = getSelectedState({\n selectedState: selectedState,\n dataItemKey: dataItemKey,\n event: {\n ctrlKey: ctrlKey,\n metaKey: metaKey,\n altKey: altKey,\n shiftKey: shiftKey,\n dataItems: dataItems,\n cell: cell,\n mode: mode,\n selectedField: selectedField,\n componentId: componentId,\n startColIndex: colIndex, endColIndex: colIndex, startRowIndex: rowIndex, endRowIndex: rowIndex,\n isDrag: false,\n syntheticEvent: syntheticEvent,\n nativeEvent: nativeEvent,\n target: event.target,\n dataItem: null\n }\n });\n }\n return selectionState;\n};\n/**\n * Get selected state from the component selection event.\n *\n * @param {{event: TableSelectionChangeEvent, selectedState: {[id: string]: boolean | number[]}, dataItemKey: string}} options\n * @returns {{[id: string]: boolean | number[]}} - The new selected state.\n */\nexport var getSelectedState = function (options) {\n var event = options.event, dataItemKey = options.dataItemKey, prevSelectedState = options.selectedState;\n var dataItems = event.dataItems, startRowIndex = event.startRowIndex, endRowIndex = event.endRowIndex, startColIndex = event.startColIndex, endColIndex = event.endColIndex, cell = event.cell, isDrag = event.isDrag, ctrlKey = event.ctrlKey, shiftKey = event.shiftKey, metaKey = event.metaKey, componentId = event.componentId, mode = event.mode, dataItem = event.dataItem;\n var idGetter = getter(dataItemKey);\n var selectionState = {};\n var isInputEvent = dataItem !== null;\n if (mode === 'single') {\n var currentDataItem = dataItems.slice(startRowIndex, startRowIndex + 1)[0];\n var itemId = idGetter(currentDataItem);\n LAST_SELECTION_STATE[componentId] = {\n rowIndex: startRowIndex,\n colIndex: startColIndex\n };\n selectionState[itemId] = cell ? [startColIndex] : true;\n }\n else if (isDrag || (!shiftKey && !ctrlKey && !metaKey && !isInputEvent)) {\n if (!isDrag) {\n LAST_SELECTION_STATE[componentId] = {\n rowIndex: startRowIndex,\n colIndex: startColIndex\n };\n }\n var selectedColumns_1 = [];\n for (var i = startColIndex; i <= endColIndex; i++) {\n selectedColumns_1.push(i);\n }\n var selectedDataItems = dataItems.slice(startRowIndex, endRowIndex + 1);\n selectedDataItems.forEach(function (currentItem) {\n var itemId = idGetter(currentItem);\n selectionState[itemId] = cell ? __spreadArray([], selectedColumns_1, true) : true;\n });\n }\n else {\n if (ctrlKey || metaKey || isInputEvent) {\n LAST_SELECTION_STATE[componentId] = {\n rowIndex: startRowIndex,\n colIndex: startColIndex\n };\n var selectedDataItems = dataItems.slice(startRowIndex, endRowIndex + 1);\n var currentDataItem = selectedDataItems[0];\n var itemId = idGetter(currentDataItem);\n selectionState = __assign({}, prevSelectedState);\n selectionState[itemId] = cell && !isInputEvent ? getCellSelection(selectionState[itemId], startColIndex) : !selectionState[itemId];\n }\n else if (shiftKey) {\n var lastRowIndex = (LAST_SELECTION_STATE[componentId] && LAST_SELECTION_STATE[componentId].rowIndex) || 0;\n var lastColIndex = (LAST_SELECTION_STATE[componentId] && LAST_SELECTION_STATE[componentId].colIndex) || 0;\n var currentStartRowIndex = Math.min(lastRowIndex, startRowIndex, endRowIndex);\n var currentEndRowIndex = Math.max(lastRowIndex, startRowIndex, endRowIndex);\n var currentStarColIndex = Math.min(lastColIndex, startColIndex, endColIndex);\n var currentEndColIndex = Math.max(lastColIndex, startColIndex, endColIndex);\n var selectedColumns_2 = [];\n for (var i = currentStarColIndex; i <= currentEndColIndex; i++) {\n selectedColumns_2.push(i);\n }\n var selectedDataItems = dataItems.slice(currentStartRowIndex, currentEndRowIndex + 1);\n selectedDataItems.forEach(function (currentItem) {\n var itemId = idGetter(currentItem);\n selectionState[itemId] = cell ? __spreadArray([], selectedColumns_2, true) : true;\n });\n }\n }\n return selectionState;\n};\n/** @hidden */\nvar HAS_RELATIVE_STACKING_CONTEXT = hasRelativeStackingContext();\n/** @hidden */\nexport var relativeContextElement = function (element) {\n if (!element || !HAS_RELATIVE_STACKING_CONTEXT) {\n return null;\n }\n var node = element.parentElement;\n while (node) {\n if (window.getComputedStyle(node).transform !== 'none') {\n return node;\n }\n node = node.parentElement;\n }\n};\n/** @hidden */\nexport var getOffset = function (offsetParent) {\n if (offsetParent && offsetParent.ownerDocument) {\n if (offsetParent !== offsetParent.ownerDocument.body) {\n var rect = offsetParent.getBoundingClientRect();\n return {\n left: rect.left - offsetParent.scrollLeft,\n top: rect.top - offsetParent.scrollTop\n };\n }\n }\n return { left: 0, top: 0 };\n};\n/** @hidden */\nexport var getSelectionOptions = function (selectable) {\n var enabled = selectable ?\n (typeof selectable.enabled === 'boolean' ? selectable.enabled : true) :\n false;\n var drag = selectable ? Boolean(selectable.drag) : false;\n var mode = selectable && selectable.mode ? selectable.mode : 'multiple';\n var cell = Boolean(selectable && selectable.cell);\n return { enabled: enabled, drag: drag, mode: mode, cell: cell };\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Draggable, useDocument } from '@progress/kendo-react-common';\nimport { closestTagName, getColumnIndex, getOffset, getRowIndex, getSelectionOptions, relativeContextElement } from './utils';\nimport { TABLE_PREVENT_SELECTION_ELEMENT } from './constants';\n/** @hidden */\nexport var TableSelection = function (props) {\n var _a;\n var onRelease = props.onRelease, childRef = props.childRef;\n var _b = getSelectionOptions(props.selectable), selectionEnabled = _b.enabled, selectionDrag = _b.drag, selectionMode = _b.mode, selectionCell = _b.cell;\n var draggableRef = React.useRef(null);\n var overlayElementRef = React.useRef(null);\n var dragStartRef = React.useRef({ clientX: 0, clientY: 0 });\n var _c = React.useState(null), overlaySettings = _c[0], setOverlaySettings = _c[1];\n var offsetParentRef = React.useRef();\n var isDraggedRef = React.useRef(false);\n var isPreventedRef = React.useRef(false);\n var onPressHandler = React.useCallback(function (eventData) {\n var event = eventData.event;\n isPreventedRef.current = event.originalEvent.target.hasAttribute(TABLE_PREVENT_SELECTION_ELEMENT);\n if (isPreventedRef.current || !draggableRef.current) {\n return;\n }\n offsetParentRef.current = relativeContextElement(draggableRef.current.element);\n dragStartRef.current = {\n clientY: event.clientY,\n clientX: event.clientX\n };\n }, []);\n var onDragHandler = React.useCallback(function (eventData) {\n var event = eventData.event;\n var _a = dragStartRef.current, clientX = _a.clientX, clientY = _a.clientY;\n if (isPreventedRef.current) {\n return;\n }\n if (!selectionDrag || selectionMode === 'single') {\n return;\n }\n if (Math.abs(clientY - event.clientY) > 5 || Math.abs(clientX - event.clientX) > 5) {\n isDraggedRef.current = true;\n }\n if (isDraggedRef.current) {\n var offset = getOffset(offsetParentRef.current);\n setOverlaySettings({\n top: Math.min(clientY, event.clientY) - offset.top,\n left: Math.min(clientX, event.clientX) - offset.left,\n width: Math.abs(event.clientX - clientX),\n height: Math.abs(event.clientY - clientY)\n });\n }\n }, [setOverlaySettings, selectionDrag, selectionMode]);\n var onReleaseHandler = React.useCallback(function (eventData) {\n var event = eventData.event;\n var _a = dragStartRef.current, clientX = _a.clientX, clientY = _a.clientY;\n if (isPreventedRef.current || !draggableRef.current) {\n return;\n }\n var currentDocument = draggableRef.current.element && draggableRef.current.element.ownerDocument;\n if (!currentDocument) {\n return;\n }\n if (!isDraggedRef.current) {\n var startElement = currentDocument.elementFromPoint(clientX, clientY);\n if (!startElement) {\n return;\n }\n var tdElement = closestTagName(startElement, 'TD');\n var trElement = closestTagName(startElement, 'TR');\n var colIndex = getColumnIndex(tdElement);\n var rowIndex = getRowIndex(trElement);\n if (tdElement && trElement && rowIndex !== undefined && colIndex !== undefined) {\n onRelease({\n nativeEvent: event.originalEvent,\n startRowIndex: rowIndex,\n startColIndex: colIndex,\n endRowIndex: rowIndex,\n endColIndex: colIndex,\n altKey: event.altKey,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n mode: selectionMode,\n cell: selectionCell,\n isDrag: false\n });\n }\n }\n else {\n var top_1 = Math.min(clientY, event.clientY);\n var left = Math.min(clientX, event.clientX);\n var bottom = Math.max(clientY, event.clientY);\n var right = Math.max(clientX, event.clientX);\n var overlayElement = overlayElementRef.current;\n if (!overlayElement) {\n return;\n }\n overlayElement.style.visibility = 'hidden';\n var startElement = currentDocument.elementFromPoint(left, top_1);\n var endElement = currentDocument.elementFromPoint(right, bottom);\n overlayElement.style.visibility = '';\n if (!startElement || !endElement) {\n return;\n }\n var startTdElement = closestTagName(startElement, 'TD');\n var startTrElement = closestTagName(startTdElement, 'TR');\n var endTdElement = closestTagName(endElement, 'TD');\n var endTrElement = closestTagName(endTdElement, 'TR');\n var startColIndex = getColumnIndex(startTdElement);\n var startRowIndex = getRowIndex(startTrElement);\n var endColIndex = getColumnIndex(endTdElement);\n var endRowIndex = getRowIndex(endTrElement);\n if (startColIndex !== undefined &&\n startRowIndex !== undefined &&\n endColIndex !== undefined &&\n endRowIndex !== undefined) {\n onRelease({\n nativeEvent: event.originalEvent,\n startRowIndex: startRowIndex,\n startColIndex: startColIndex,\n endRowIndex: endRowIndex,\n endColIndex: endColIndex,\n altKey: event.altKey,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n mode: selectionMode,\n cell: selectionCell,\n isDrag: true\n });\n }\n }\n setOverlaySettings(null);\n isDraggedRef.current = false;\n dragStartRef.current = { clientX: 0, clientY: 0 };\n }, [setOverlaySettings, selectionMode, selectionCell, onRelease]);\n var getDocument = useDocument(overlayElementRef);\n if (!selectionEnabled) {\n return (React.cloneElement(React.Children.only(props.children), { ref: childRef }));\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(Draggable, { onPress: onPressHandler, onDrag: onDragHandler, onRelease: onReleaseHandler, ref: draggableRef, childRef: childRef }, props.children),\n overlaySettings &&\n ReactDOM.createPortal(React.createElement(\"div\", { ref: overlayElementRef, style: __assign(__assign({}, overlaySettings), { position: 'fixed' }), className: 'k-marquee k-marquee-color' }), (_a = getDocument()) === null || _a === void 0 ? void 0 : _a.body)));\n};\n","import * as PropTypes from 'prop-types';\n/**\n * @hidden\n */\nexport var GridColumn = function (_) { return null; };\n/**\n * @hidden\n */\nGridColumn.displayName = 'KendoReactGridColumn';\n/**\n * @hidden\n */\nGridColumn.defaultProps = {\n filterable: true,\n editable: true,\n sortable: true,\n resizable: true,\n reorderable: true,\n groupable: true\n};\n/**\n * @hidden\n */\nGridColumn.propTypes = {\n field: PropTypes.string,\n title: PropTypes.string,\n editable: PropTypes.bool,\n sortable: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n allowUnsort: PropTypes.bool.isRequired\n })\n ]),\n cell: PropTypes.any,\n filterCell: PropTypes.any,\n filterTitle: PropTypes.string,\n filterable: PropTypes.bool,\n filter: PropTypes.oneOf(['text', 'numeric', 'boolean', 'date']),\n editor: PropTypes.oneOf(['text', 'numeric', 'boolean', 'date']),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n minResizableWidth: PropTypes.number,\n headerCell: PropTypes.any,\n footerCell: PropTypes.any,\n headerSelectionValue: PropTypes.bool,\n format: PropTypes.string,\n headerClassName: PropTypes.string,\n className: PropTypes.string,\n reorderable: PropTypes.bool,\n resizable: PropTypes.bool,\n orderIndex: PropTypes.number,\n groupable: PropTypes.bool,\n columnMenu: PropTypes.any,\n locked: PropTypes.bool\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n/**\n * @hidden\n */\nexport function getNestedValue(fieldName, dataItem) {\n var path = (fieldName || '').split('.');\n var data = dataItem;\n path.forEach(function (p) {\n data = data ? data[p] : undefined;\n });\n return data;\n}\n/**\n * @hidden\n */\nexport function flatData(output, input, footer, dataIndex, groupDefined, field, level) {\n if (level === void 0) { level = 0; }\n var maxLevel = level;\n for (var i = 0; i < input.length; i++) {\n if (!groupDefined || input[i].value === undefined || input[i].items === undefined) {\n output[output.length] = {\n dataIndex: dataIndex.index,\n dataItem: input[i],\n rowType: 'data',\n level: level,\n expanded: field === undefined || getNestedValue(field, input[i])\n };\n dataIndex.index++;\n continue;\n }\n maxLevel = Math.max(maxLevel, level + 1);\n var expanded = field === undefined ||\n getNestedValue(field, input[i]) === undefined ||\n getNestedValue(field, input[i]);\n // header\n output[output.length] = {\n dataIndex: -1,\n dataItem: input[i],\n level: level,\n rowType: 'groupHeader',\n expanded: expanded\n };\n // children\n if (expanded) {\n maxLevel = Math.max(flatData(output, input[i].items, footer, dataIndex, groupDefined, field, level + 1), maxLevel);\n }\n // footer\n if (footer === 'always' || (expanded && footer === 'visible')) {\n output[output.length] = {\n dataIndex: -1,\n dataItem: input[i],\n rowType: 'groupFooter',\n level: level,\n expanded: expanded\n };\n }\n }\n return maxLevel;\n}\nvar eventKeys = [\n 'sortChange',\n 'filterChange',\n 'groupChange',\n 'pageChange',\n 'expandChange',\n 'selectionChange',\n 'headerSelectionChange',\n 'rowClick',\n 'itemChange',\n 'dataStateChange',\n 'columnResize',\n 'columnReorder'\n];\nvar deprecatedHandlerMessage = function (oldKey, newKey) { return (\"The \".concat(oldKey, \" event handler property is deprecated, \") +\n \"use https://www.telerik.com/kendo-react-ui/components/grid/api/GridProps/#toc-\".concat(newKey, \" instead\")); };\n/**\n * @hidden\n */\nexport function checkPropCompatibility(props) {\n for (var index = 0; index < eventKeys.length; index++) {\n var eventKey = eventKeys[index];\n if (props[eventKey] !== undefined) {\n var newKey = 'on' + eventKey.charAt(0).toUpperCase() + eventKey.slice(1);\n console.warn(deprecatedHandlerMessage(eventKey, newKey));\n }\n }\n}\nimport { GridColumn } from '../GridColumn';\nimport { tableKeyboardNavigationTools as navigationTools } from '@progress/kendo-react-data-tools';\n/**\n * @hidden\n */\nexport function readColumns(elements, oldColumns, idInfo, depth) {\n if (depth === void 0) { depth = 0; }\n var columns = [];\n if (!elements) {\n return [];\n }\n if (elements && elements.length === undefined) {\n elements = [elements];\n }\n elements.forEach(function (columnProps, index) {\n columnProps = columnProps.props ? columnProps.props : columnProps;\n var oldColumn = oldColumns[index] || null;\n var children = readColumns(columnProps.children, oldColumn && oldColumn.children || [], idInfo, depth + 1);\n columns.push(Object.assign({ depth: depth }, GridColumn.defaultProps, (children.length) ? { cell: function () { return null; }, filterCell: function () { return null; } } : {}, oldColumn ? { width: oldColumn.width, orderIndex: oldColumn.orderIndex } : {}, columnProps, {\n id: columnProps.id ? columnProps.id : navigationTools.generateNavigatableId(\"\".concat(idInfo.prevId++), idInfo.idPrefix, 'column'),\n declarationIndex: columns.length,\n children: children,\n rowSpan: 0,\n colSpan: 0,\n isAccessible: true,\n left: oldColumn && Math.floor(oldColumn.left),\n right: oldColumn && Math.floor(oldColumn.right)\n }));\n });\n var comparator = function (a, b) {\n return a.orderIndex === b.orderIndex ?\n a.declarationIndex - b.declarationIndex :\n ((a.orderIndex || 0) - (b.orderIndex || 0));\n };\n columns.sort(comparator);\n if (depth === 0) {\n var ret_1 = [];\n var flat_1 = function (cols, pIndex) {\n return cols.forEach(function (c) {\n c.parentIndex = pIndex;\n flat_1(c.children, ret_1.push(c) - 1);\n });\n };\n flat_1(columns, -1);\n return ret_1;\n }\n return columns;\n}\n/**\n * @hidden\n */\nexport function autoGenerateColumns(data, group, expandField, idInfo) {\n var propData = [];\n if (Array.isArray(data)) {\n propData = data;\n }\n else if (data) {\n propData = data.data;\n }\n var columns = [];\n if (propData.length > 0) {\n var itemForColumnsGen = propData[0];\n if (group) {\n for (var i = 0; i < group.length; i++) {\n itemForColumnsGen = itemForColumnsGen.items && itemForColumnsGen.items[0];\n }\n }\n var fields = Object.getOwnPropertyNames(itemForColumnsGen);\n fields.forEach(function (field) {\n if (field !== expandField) {\n columns.push(Object.assign({\n id: navigationTools.generateNavigatableId(\"\".concat(idInfo.prevId++), idInfo.idPrefix, 'column'),\n declarationIndex: -1,\n parentIndex: -1,\n depth: 0,\n colSpan: 0,\n rowSpan: 0,\n index: 0,\n left: 0,\n right: 0,\n rightBorder: false,\n children: [],\n ariaColumnIndex: 0,\n isAccessible: true\n }, GridColumn.defaultProps, { field: field }));\n }\n });\n }\n return columns;\n}\nvar hasParentFooterCell = function (columns, column) {\n var parent = columns[column.parentIndex];\n while (parent) {\n if (parent.footerCell) {\n return true;\n }\n parent = columns[parent.parentIndex];\n }\n return false;\n};\n/**\n * @hidden\n */\nexport var footerColumns = function (columns) {\n return columns.filter(function (column) {\n if (hasParentFooterCell(columns, column)) {\n return false;\n }\n return Boolean(column.footerCell) || !(column.children && column.children.length > 0);\n });\n};\n/**\n * @hidden\n */\nexport var getColumnWidth = function (column) {\n return column.width !== undefined\n ? Math.floor(parseFloat(column.width.toString())) + 'px'\n : undefined;\n};\n/**\n * @hidden\n */\nexport var sanitizeColumns = function (columns) {\n columns.sort(function (a, b) {\n return a.declarationIndex - b.declarationIndex;\n });\n return columns.map(function (column) {\n var declarationIndex = column.declarationIndex, parentIndex = column.parentIndex, depth = column.depth, colSpan = column.colSpan, rowSpan = column.rowSpan, index = column.index, kFirst = column.kFirst, children = column.children, props = __rest(column, [\"declarationIndex\", \"parentIndex\", \"depth\", \"colSpan\", \"rowSpan\", \"index\", \"kFirst\", \"children\"]);\n return children.length ? __assign({ children: sanitizeColumns(children) }, props) : props;\n });\n};\n/**\n * @hidden\n */\nexport var firefox = typeof window !== 'undefined' &&\n /Firefox/.test(window.navigator.userAgent);\n/**\n * @hidden\n */\nexport var firefoxMaxHeight = 17895697;\n/**\n * @hidden\n */\nexport var resolveCells = function (gridCells, columnCells) {\n if (!gridCells && !columnCells) {\n return undefined;\n }\n if (!columnCells) {\n return gridCells;\n }\n if (!gridCells) {\n return columnCells;\n }\n return __assign(__assign(__assign({}, gridCells), columnCells), { select: __assign(__assign({}, (gridCells.select || {})), (columnCells.select || {})), hierarchy: __assign(__assign({}, (gridCells.hierarchy || {})), (columnCells.hierarchy || {})), group: __assign(__assign({}, (gridCells.group || {})), (columnCells.group || {})), edit: __assign(__assign({}, (gridCells.edit || {})), (columnCells.edit || {})) });\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { getNestedValue } from './../utils';\nimport { guid } from '@progress/kendo-react-common';\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\n/**\n * @hidden\n */\nexport var GridSelectionCell = function (props) {\n var _a;\n var handleOnChange = React.useCallback(function (syntheticEvent) {\n if (props.selectionChange) {\n props.selectionChange({ syntheticEvent: syntheticEvent });\n }\n }, [props.selectionChange]);\n var inputId = React.useMemo(function () { return guid(); }, []);\n var selectedValue = getNestedValue(props.field, props.dataItem);\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n var tdProps = __assign((_a = { colSpan: props.colSpan, style: props.style, className: props.className }, _a['aria-colindex'] = props.ariaColumnIndex, _a.role = 'gridcell', _a), navigationAttributes);\n var content = [\n (React.createElement(\"input\", { key: \"1\", checked: typeof selectedValue === 'boolean' && selectedValue, id: inputId, type: \"checkbox\", className: \"k-checkbox k-checkbox-md k-rounded-md\", onChange: handleOnChange })),\n (React.createElement(\"label\", { className: \"k-checkbox-label\", htmlFor: inputId, key: \"2\" }))\n ];\n var defaultRendering = props.rowType !== 'groupHeader' ? (React.createElement(\"td\", __assign({}, tdProps), content)) : null;\n var rowTypeSetting = props.rowType || 'data';\n var customCells = props.cells;\n if (customCells && customCells.select && customCells.select[rowTypeSetting]) {\n var CustomCell = customCells.select[rowTypeSetting];\n return (React.createElement(CustomCell, __assign({}, props, { tdProps: tdProps }), content));\n }\n return props.render ?\n props.render.call(undefined, defaultRendering, props) :\n defaultRendering;\n};\n","var _a;\n/**\n * @hidden\n */\nexport var noRecords = 'grid.noRecords';\n/**\n * @hidden\n */\nexport var pagerInfo = 'grid.pagerInfo';\n/**\n * @hidden\n */\nexport var pagerFirstPage = 'grid.pagerFirstPage';\n/**\n * @hidden\n */\nexport var pagerPreviousPage = 'grid.pagerPreviousPage';\n/**\n * @hidden\n */\nexport var pagerNextPage = 'grid.pagerNextPage';\n/**\n * @hidden\n */\nexport var pagerLastPage = 'grid.pagerLastPage';\n/**\n * @hidden\n */\nexport var pagerItemPerPage = 'grid.pagerItemsPerPage';\n/**\n * @hidden\n */\nexport var pagerPage = 'grid.pagerPage';\n/**\n * @hidden\n */\nexport var pagerPageSizeAriaLabel = 'grid.pagerPageSizeAriaLabel';\n/**\n * @hidden\n */\nexport var pagerOf = 'grid.pagerOf';\n/**\n * @hidden\n */\nexport var pagerTotalPages = 'grid.pagerTotalPages';\n/**\n * @hidden\n */\nexport var groupPanelEmpty = 'grid.groupPanelEmpty';\n/**\n * @hidden\n */\nexport var groupColumn = 'grid.groupColumn';\n/**\n * @hidden\n */\nexport var ungroupColumn = 'grid.ungroupColumn';\n/**\n * @hidden\n */\nexport var columnMenu = 'grid.columnMenu';\n/**\n * @hidden\n */\nexport var filterClearButton = 'grid.filterClearButton';\n/**\n * @hidden\n */\nexport var filterSubmitButton = 'grid.filterSubmitButton';\n/**\n * @hidden\n */\nexport var filterTitle = 'grid.filterTitle';\n/**\n * @hidden\n */\nexport var sortAscending = 'grid.sortAscending';\n/**\n * @hidden\n */\nexport var sortDescending = 'grid.sortDescending';\n/**\n * @hidden\n */\nexport var searchPlaceholder = 'grid.searchPlaceholder';\n/**\n * @hidden\n */\nexport var filterCheckAll = 'grid.filterCheckAll';\n/**\n * @hidden\n */\nexport var filterChooseOperator = 'grid.filterChooseOperator';\n/**\n * @hidden\n */\nexport var filterSelectedItems = 'grid.filterSelectedItems';\n/**\n * @hidden\n */\nexport var sortAriaLabel = 'grid.sortAriaLabel';\n/**\n * @hidden\n */\nexport var filterAriaLabel = 'grid.filterAriaLabel';\n/**\n * @hidden\n */\nexport var groupPanelAriaLabel = 'grid.groupPanelAriaLabel';\n/**\n * @hidden\n */\nexport var groupExpand = 'grid.groupExpand';\n/**\n * @hidden\n */\nexport var groupCollapse = 'grid.groupCollapse';\n/**\n * @hidden\n */\nexport var detailExpand = 'grid.detailExpand';\n/**\n * @hidden\n */\nexport var detailCollapse = 'grid.detailCollapse';\n/**\n * @hidden\n */\nexport var messages = (_a = {},\n _a[detailExpand] = 'Expand detail row',\n _a[detailCollapse] = 'Collapse detail row',\n _a[groupExpand] = 'Expand group',\n _a[groupCollapse] = 'Collapse Group',\n _a[noRecords] = 'No records available',\n _a[groupPanelEmpty] = 'Drag a column header and drop it here to group by that column',\n _a[filterClearButton] = 'Clear',\n _a[filterSubmitButton] = 'Filter',\n _a[filterTitle] = 'Filter',\n _a[sortAscending] = 'Sort Ascending',\n _a[sortDescending] = 'Sort Descending',\n _a[sortAriaLabel] = 'Sortable',\n _a[groupColumn] = 'Group Column',\n _a[ungroupColumn] = 'Ungroup Column',\n _a[columnMenu] = 'Column menu',\n _a[pagerItemPerPage] = 'items per page',\n _a[pagerInfo] = '{0} - {1} of {2} items',\n _a[pagerFirstPage] = 'Go to the first page',\n _a[pagerPreviousPage] = 'Go to the previous page',\n _a[pagerNextPage] = 'Go to the next page',\n _a[pagerLastPage] = 'Go to the last page',\n _a[pagerPage] = 'Page',\n _a[pagerPageSizeAriaLabel] = 'Page size',\n _a[pagerOf] = 'of',\n _a[pagerTotalPages] = '{0}',\n _a[searchPlaceholder] = 'Search',\n _a[filterCheckAll] = 'Check All',\n _a[filterChooseOperator] = 'Choose Operator',\n _a[filterSelectedItems] = 'selected items',\n _a[filterAriaLabel] = 'Filter',\n _a[groupPanelAriaLabel] = 'Group panel',\n _a['grid.filterEqOperator'] = 'Is equal to',\n _a['grid.filterNotEqOperator'] = 'Is not equal to',\n _a['grid.filterIsNullOperator'] = 'Is null',\n _a['grid.filterIsNotNullOperator'] = 'Is not null',\n _a['grid.filterIsEmptyOperator'] = 'Is empty',\n _a['grid.filterIsNotEmptyOperator'] = 'Is not empty',\n _a['grid.filterStartsWithOperator'] = 'Starts with',\n _a['grid.filterContainsOperator'] = 'Contains',\n _a['grid.filterNotContainsOperator'] = 'Does not contain',\n _a['grid.filterEndsWithOperator'] = 'Ends with',\n _a['grid.filterGteOperator'] = 'Is greater than or equal to',\n _a['grid.filterGtOperator'] = 'Is greater than',\n _a['grid.filterLteOperator'] = 'Is less than or equal to',\n _a['grid.filterLtOperator'] = 'Is less than',\n _a['grid.filterIsTrue'] = 'Is true',\n _a['grid.filterIsFalse'] = 'Is false',\n _a['grid.filterBooleanAll'] = '(All)',\n _a['grid.filterAfterOrEqualOperator'] = 'Is after or equal to',\n _a['grid.filterAfterOperator'] = 'Is after',\n _a['grid.filterBeforeOperator'] = 'Is before',\n _a['grid.filterBeforeOrEqualOperator'] = 'Is before or equal to',\n _a['grid.filterAndLogic'] = 'And',\n _a['grid.filterOrLogic'] = 'Or',\n _a);\n/**\n * @hidden\n */\nexport function pagerMessagesMap(pagerMessageKey) {\n var messageKey = pagerMessageKey.replace(/^pager\\.([a-z])/, function (_match, group) { return 'grid.pager' + group.toUpperCase(); });\n return ({ messageKey: messageKey, defaultMessage: messages[messageKey] });\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { getNestedValue } from './../utils';\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport { useLocalization } from '@progress/kendo-react-intl';\nimport { IconWrap, Keys } from '@progress/kendo-react-common';\nimport { detailCollapse, detailExpand, messages } from '../messages';\nimport { minusIcon, plusIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nexport var GridHierarchyCell = function (props) {\n var defaultRendering = null;\n var tdProps = null;\n var content = null;\n var expanded = getNestedValue(props.field, props.dataItem);\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n var localization = useLocalization();\n var onKeyDownHandler = React.useCallback(function (event) {\n if (event.isDefaultPrevented()) {\n return;\n }\n if (event.keyCode === Keys.enter && props.onChange) {\n event.preventDefault();\n props.onChange({\n dataItem: props.dataItem,\n dataIndex: props.dataIndex,\n syntheticEvent: event,\n field: props.field,\n value: !expanded\n });\n }\n }, [props.dataItem, props.dataIndex, props.field, props.onChange, expanded]);\n if (props.rowType === 'groupFooter') {\n tdProps = __assign({ className: 'k-table-td k-hierarchy-cell', role: 'gridcell' }, navigationAttributes);\n defaultRendering =\n React.createElement(\"td\", __assign({}, tdProps));\n }\n else if (props.rowType !== 'groupHeader') {\n var baseMessage = expanded ? detailCollapse : detailExpand;\n var message = localization.toLanguageString(baseMessage, messages[baseMessage]);\n tdProps = __assign({ className: 'k-table-td k-hierarchy-cell', onKeyDown: onKeyDownHandler, 'aria-expanded': expanded ? true : false, role: 'gridcell', 'aria-colindex': props.ariaColumnIndex }, navigationAttributes);\n content = (React.createElement(\"a\", { onClick: function (e) {\n e.preventDefault();\n if (props.onChange) {\n props.onChange({\n dataItem: props.dataItem,\n dataIndex: props.dataIndex,\n syntheticEvent: e,\n field: props.field,\n value: !expanded\n });\n }\n }, \"aria-label\": message, href: \"#\", tabIndex: -1 },\n React.createElement(IconWrap, { name: expanded ? 'minus' : 'plus', icon: expanded ? minusIcon : plusIcon })));\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n }\n var rowTypeSetting = props.rowType || 'data';\n var customCells = props.cells;\n if (customCells && customCells.hierarchy && customCells.hierarchy[rowTypeSetting]) {\n var CustomCell = customCells.hierarchy[rowTypeSetting];\n return (React.createElement(CustomCell, __assign({}, props, { tdProps: tdProps }), content));\n }\n return props.render ?\n props.render.call(undefined, defaultRendering, props) :\n defaultRendering;\n};\n","import { TABLE_COL_INDEX_ATTRIBUTE, TABLE_PREVENT_SELECTION_ELEMENT, TABLE_ROW_INDEX_ATTRIBUTE } from '@progress/kendo-react-data-tools';\n/** The attribute required by the Grid selection on Grid `tr` elements. */\nexport var GRID_ROW_INDEX_ATTRIBUTE = TABLE_ROW_INDEX_ATTRIBUTE;\n/** The attribute required by the Grid selection on Grid `td` elements. */\nexport var GRID_COL_INDEX_ATTRIBUTE = TABLE_COL_INDEX_ATTRIBUTE;\n/** Attribute which disable selection start from this element. */\nexport var GRID_PREVENT_SELECTION_ELEMENT = TABLE_PREVENT_SELECTION_ELEMENT;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { getNestedValue } from './../utils';\nimport { NumericTextBox } from '@progress/kendo-react-inputs';\nimport { DatePicker } from '@progress/kendo-react-dateinputs';\nimport { guid, classNames } from '@progress/kendo-react-common';\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport { GRID_COL_INDEX_ATTRIBUTE } from '../constants';\n/**\n * @hidden\n */\nexport var GridEditCell = function (props) {\n var _a, _b, _c, _d, _e;\n var data = getNestedValue(props.field, props.dataItem);\n var defaultRendering = null;\n var editCellClasses = classNames('k-table-td', 'k-grid-edit-cell', (_a = {},\n _a['k-selected'] = props.isSelected,\n _a), props.className);\n var inputId = React.useMemo(function () { return guid(); }, []);\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n var tdProps = null;\n var content = null;\n var handleOnChange = React.useCallback(function (syntheticEvent) {\n if (props.onChange) {\n var value = syntheticEvent.target.type === 'checkbox' ?\n syntheticEvent.target.checked :\n syntheticEvent.target.value;\n props.onChange({\n dataItem: props.dataItem,\n dataIndex: props.dataIndex,\n field: props.field,\n syntheticEvent: syntheticEvent,\n value: value\n });\n }\n }, [props.onChange, props.dataItem, props.dataIndex, props.field]);\n var onContextMenu = React.useCallback(function (event) {\n if (props.onContextMenu) {\n props.onContextMenu.call(undefined, event, props.dataItem, props.field);\n }\n }, [props.onContextMenu, props.dataItem, props.field]);\n var inputChange = React.useCallback(function (e) {\n if (props.onChange) {\n props.onChange({\n dataItem: props.dataItem,\n dataIndex: props.dataIndex,\n field: props.field,\n syntheticEvent: e.syntheticEvent,\n value: e.value\n });\n }\n }, [props.onChange, props.dataItem, props.dataIndex, props.field]);\n switch (props.editor) {\n case 'numeric':\n tdProps = __assign((_b = { onContextMenu: onContextMenu, colSpan: props.colSpan, style: props.style, className: editCellClasses }, _b['aria-colindex'] = props.ariaColumnIndex, _b['aria-selected'] = props.isSelected, _b[GRID_COL_INDEX_ATTRIBUTE] = props.columnIndex, _b.role = 'gridcell', _b), navigationAttributes);\n content = (React.createElement(NumericTextBox, { width: \"100%\", value: (data === undefined) ? null : data, onChange: inputChange }));\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n break;\n case 'date':\n tdProps = __assign((_c = { onContextMenu: onContextMenu, colSpan: props.colSpan, style: props.style, className: editCellClasses }, _c['aria-colindex'] = props.ariaColumnIndex, _c['aria-selected'] = props.isSelected, _c[GRID_COL_INDEX_ATTRIBUTE] = props.columnIndex, _c.role = 'gridcell', _c), navigationAttributes);\n content = (React.createElement(DatePicker, { width: \"100%\", value: data, onChange: inputChange }));\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n break;\n case 'boolean':\n tdProps = __assign((_d = { onContextMenu: onContextMenu, colSpan: props.colSpan, style: props.style, className: editCellClasses }, _d['aria-colindex'] = props.ariaColumnIndex, _d['aria-selected'] = props.isSelected, _d[GRID_COL_INDEX_ATTRIBUTE] = props.columnIndex, _d.role = 'gridcell', _d), navigationAttributes);\n content = ([\n React.createElement(\"input\", { checked: data || false, id: inputId, type: \"checkbox\", className: \"k-checkbox k-checkbox-md k-rounded-md\", onChange: handleOnChange, key: 1 }),\n React.createElement(\"label\", { className: \"k-checkbox-label\", htmlFor: inputId, key: 2 })\n ]);\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n break;\n default:\n tdProps = __assign((_e = { onContextMenu: onContextMenu, colSpan: props.colSpan, style: props.style, className: editCellClasses }, _e['aria-colindex'] = props.ariaColumnIndex, _e['aria-selected'] = props.isSelected, _e[GRID_COL_INDEX_ATTRIBUTE] = props.columnIndex, _e.role = 'gridcell', _e), navigationAttributes);\n content = (React.createElement(\"input\", { style: { width: '100%' }, className: \"k-input\", value: data || '', onChange: handleOnChange }));\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n }\n var editorSetting = props.editor || 'text';\n var customCells = props.cells;\n if (customCells && customCells.edit && customCells.edit[editorSetting]) {\n var CustomCell = customCells.edit[editorSetting];\n return (React.createElement(CustomCell, __assign({}, props, { tdProps: tdProps }), content));\n }\n return props.render ?\n props.render.call(undefined, defaultRendering, props) :\n defaultRendering;\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { classNames, getScrollbarWidth, kendoThemeMaps } from '@progress/kendo-react-common';\nimport { isRtl, tableKeyboardNavigationHeaderAttributes } from '@progress/kendo-react-data-tools';\n/**\n * @hidden\n */\nvar Header = /** @class */ (function (_super) {\n __extends(Header, _super);\n function Header() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.headerWrap = null;\n _this.table = null;\n _this.syncScroll = false;\n _this.scrollbarWidth = getScrollbarWidth();\n _this.onScroll = function (_event) {\n if (_this.syncScroll) {\n _this.syncScroll = false;\n return;\n }\n if (!_this.headerWrap) {\n return;\n }\n var scrollLeft = _this.headerWrap.scrollLeft;\n var scrollableDataElement = _this.props.scrollableDataElement();\n if (scrollableDataElement && scrollableDataElement.scrollLeft !== scrollLeft) {\n scrollableDataElement.scrollLeft = scrollLeft;\n }\n };\n return _this;\n }\n Object.defineProperty(Header.prototype, \"element\", {\n get: function () {\n return this.props.elemRef.current;\n },\n enumerable: false,\n configurable: true\n });\n Header.prototype.componentDidMount = function () {\n var rtl = isRtl(this.element);\n if (this.props.columnResize) {\n this.props.columnResize.setIsRtl(rtl);\n }\n this.forceUpdate();\n };\n /**\n *\n * @param scrollLeft - Scrolls to the left (in pixels).\n */\n Header.prototype.setScrollLeft = function (scrollLeft) {\n if (this.headerWrap && this.headerWrap.scrollLeft !== scrollLeft) {\n this.syncScroll = true;\n this.headerWrap.scrollLeft = scrollLeft;\n }\n };\n /**\n *\n * @param width - Scrolls the width (in pixels).\n */\n Header.prototype.setWidth = function (width) {\n if (this.table) {\n this.table.style.width = width + 'px';\n }\n };\n Header.prototype.render = function () {\n var _a;\n var _this = this;\n if (!this.props.staticHeaders) {\n return (React.createElement(\"thead\", __assign({ role: \"presentation\", className: classNames('k-table-thead', { 'k-grid-draggable-header': this.props.draggable }) }, tableKeyboardNavigationHeaderAttributes),\n this.props.headerRow,\n this.props.filterRow));\n }\n return (React.createElement(\"div\", { ref: this.props.elemRef, className: classNames('k-grid-header', { 'k-grid-draggable-header': this.props.draggable }), role: \"presentation\" },\n React.createElement(\"div\", { ref: function (div) { _this.headerWrap = div; }, className: \"k-grid-header-wrap\", style: this.scrollbarWidth ? {} : { borderWidth: 0 }, onScroll: this.onScroll, role: \"presentation\" },\n React.createElement(\"table\", { ref: function (table) { _this.table = table; }, className: classNames('k-table k-grid-header-table', (_a = {\n 'k-table-md': !this.props.size\n },\n _a[\"k-table-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _a), this.props.className), role: \"presentation\" },\n React.createElement(\"colgroup\", { ref: function (e) { _this.props.columnResize.colGroupHeader = e; } }, this.props.cols),\n React.createElement(\"thead\", __assign({ className: 'k-table-thead', role: \"rowgroup\" }, tableKeyboardNavigationHeaderAttributes),\n this.props.headerRow,\n this.props.filterRow)))));\n };\n return Header;\n}(React.Component));\nexport { Header };\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/**\n * @hidden\n */\nexport var normalize = function () {\n var settings = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n settings[_i] = arguments[_i];\n }\n return Object.assign.apply(Object, __spreadArray([{ allowUnsort: true, mode: 'single' }], settings, false));\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { Draggable } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar ColumnDraggable = /** @class */ (function (_super) {\n __extends(ColumnDraggable, _super);\n function ColumnDraggable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.draggable = null;\n /**\n * @hidden\n */\n _this.onPress = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.pressHandler) {\n _this.props.pressHandler(data.event, element);\n }\n };\n /**\n * @hidden\n */\n _this.onDrag = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.dragHandler) {\n _this.props.dragHandler(data.event, element);\n }\n };\n /**\n * @hidden\n */\n _this.onRelease = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.releaseHandler) {\n _this.props.releaseHandler(data.event);\n }\n };\n return _this;\n }\n ColumnDraggable.prototype.render = function () {\n var _this = this;\n return (React.createElement(Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, hint: this.props.dragClue, autoScroll: { boundaryElementRef: this.props.headerRef, direction: { horizontal: true, vertical: false } }, scrollContainer: this.props.containerRef || undefined, ref: function (component) { _this.draggable = component; } },\n React.createElement(\"tr\", { className: 'k-table-row', style: { touchAction: 'none' }, role: \"row\", \"aria-rowindex\": this.props.ariaRowIndex }, this.props.children)));\n };\n return ColumnDraggable;\n}(React.PureComponent));\nexport { ColumnDraggable };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { Popup } from '@progress/kendo-react-popup';\nimport { IconWrap } from '@progress/kendo-react-common';\nimport { moreVerticalIcon } from '@progress/kendo-svg-icons';\nimport { columnMenu, messages } from '../messages';\nimport { provideLocalizationService } from '@progress/kendo-react-intl';\n/**\n * The GridColumnMenuWrapper component.\n */\nvar GridColumnMenuWrapper = /** @class */ (function (_super) {\n __extends(GridColumnMenuWrapper, _super);\n function GridColumnMenuWrapper() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** @hidden */\n _this.state = {\n show: false\n };\n /** @hidden */\n _this._anchor = null;\n /** @hidden */\n _this._content = null;\n /** @hidden */\n _this.blurTimeout = undefined;\n /** @hidden */\n _this.willBlur = false;\n /** @hidden */\n _this.blur = function () {\n if (_this.willBlur) {\n _this.willBlur = false;\n return;\n }\n clearTimeout(_this.blurTimeout);\n _this.blurTimeout = window.setTimeout(function () { _this.closeMenu(); });\n };\n /** @hidden */\n _this.focus = function () {\n clearTimeout(_this.blurTimeout);\n };\n /** @hidden */\n _this.anchorClick = function (event) {\n event.preventDefault();\n _this.setState({\n show: !_this.state.show\n }, function () { return _this.state.show && _this._content && _this._content.focus(); });\n };\n /** @hidden */\n _this.closeMenu = function () {\n _this.setState({ show: false });\n };\n /** @hidden */\n _this.onAnchorMouseDown = function (event) {\n _this.willBlur = _this.state.show && event.currentTarget === _this._anchor;\n };\n /** @hidden */\n _this.onAnchorFocus = function (event) {\n var _a;\n var elementToFocus = event.target;\n var parentScroll = elementToFocus && ((_a = elementToFocus.closest('.k-grid')) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('k-grid-content')[0]);\n var hasHorizontalScrollbar = parentScroll && (parentScroll.scrollWidth > parentScroll.clientWidth);\n if (hasHorizontalScrollbar) {\n elementToFocus.scrollIntoView({ inline: 'center' });\n }\n };\n return _this;\n }\n GridColumnMenuWrapper.prototype.render = function () {\n var _this = this;\n var _a = this.props, ColumnMenu = _a.columnMenu, others = __rest(_a, [\"columnMenu\"]);\n var column = this.props.column;\n var localizationService = provideLocalizationService(this);\n var fieldMessage = column.title || column.field;\n var field = fieldMessage ? \"\".concat(fieldMessage, \" \") : '';\n return (React.createElement(React.Fragment, null,\n React.createElement(\"a\", { className: 'k-grid-header-menu k-grid-column-menu', ref: function (e) { return _this._anchor = e; }, onClick: this.anchorClick, onMouseDown: this.onAnchorMouseDown, onFocus: this.onAnchorFocus, href: \"#\", \"aria-label\": \"\".concat(field).concat(localizationService.toLanguageString(columnMenu, messages[columnMenu])) },\n React.createElement(IconWrap, { name: 'more-vertical', icon: moreVerticalIcon })),\n React.createElement(Popup, { anchor: this._anchor, show: this.state.show },\n React.createElement(\"div\", { ref: function (e) { return _this._content = e; }, className: 'k-grid-columnmenu-popup', tabIndex: 0, onBlur: this.blur, onFocus: this.focus, style: { outline: 'none' } }, ColumnMenu && (React.createElement(ColumnMenu, __assign({}, others, { onCloseMenu: this.closeMenu })))))));\n };\n return GridColumnMenuWrapper;\n}(React.Component));\nexport { GridColumnMenuWrapper };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { classNames } from '@progress/kendo-react-common';\nimport * as React from 'react';\nimport { GridColumnMenuWrapper } from '../columnMenu/GridColumnMenuWrapper';\n/**\n * @example\n * ```jsx\n * class App extends React.PureComponent {\n * state = {\n * details: false,\n * data: [\n * { foo: 'A1', bar: 'B1', b1: 1, b2:2 },\n * { foo: 'A2', bar: 'B2', b1: 3, b2:4 },\n * { foo: 'A3', bar: 'B2', b1: 5, b2:6 }\n * ]\n * };\n *\n * CustomHeaderCell = (props) =>\n * \n * {props.title || props.field + ' '}\n * \n * {props.children}\n * \n *\n * render() {\n * return (\n * \n * \n * \n * {this.state.barDetails && [\n * ,\n * \n * ]}\n * \n * \n * );\n * }\n * }\n *\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nvar GridHeaderCell = /** @class */ (function (_super) {\n __extends(GridHeaderCell, _super);\n function GridHeaderCell() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n GridHeaderCell.prototype.render = function () {\n var columnMenuWrapperProps = this.props.columnMenuWrapperProps;\n var clickProps = this.props.onClick ? {\n onClick: this.props.onClick\n } : {};\n var defaultRendering = (React.createElement(\"span\", { className: 'k-cell-inner' },\n React.createElement(\"span\", __assign({ className: classNames('k-link', {\n '!k-cursor-default': !this.props.columnMenuWrapperProps.sortable\n }) }, clickProps),\n React.createElement(\"span\", { className: 'k-column-title' }, this.props.title || this.props.field || '\\u00A0'),\n this.props.children),\n columnMenuWrapperProps.columnMenu && React.createElement(GridColumnMenuWrapper, __assign({}, columnMenuWrapperProps))));\n if (this.props.render) {\n return this.props.render.call(undefined, defaultRendering, this.props);\n }\n return defaultRendering;\n };\n return GridHeaderCell;\n}(React.Component));\nexport { GridHeaderCell };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { normalize } from '../interfaces/GridSortSettings';\nimport { ColumnDraggable } from '../drag/ColumnDraggable';\nimport { GridHeaderCell } from './GridHeaderCell';\nimport { classNames, IconWrap, Keys } from '@progress/kendo-react-common';\nimport { HeaderThElement, ColumnResizer } from '@progress/kendo-react-data-tools';\nimport { registerForLocalization, provideLocalizationService as intl } from '@progress/kendo-react-intl';\nimport { messages, sortAriaLabel } from '../messages';\nimport { sortAscSmallIcon, sortDescSmallIcon } from '@progress/kendo-svg-icons';\nimport { resolveCells } from '../utils';\n/**\n * @hidden\n */\nvar sortSeqMap = {\n true: { 'asc': 'desc', 'desc': '', '': 'asc' },\n false: { 'asc': 'desc', 'desc': 'asc', '': 'asc' }\n};\n/**\n * @hidden\n */\nvar ariaSortMap = {\n 'none': 'none',\n 'asc': 'ascending',\n 'desc': 'descending'\n};\n/**\n * @hidden\n */\nvar HeaderRow = /** @class */ (function (_super) {\n __extends(HeaderRow, _super);\n function HeaderRow(props) {\n var _this = _super.call(this, props) || this;\n _this.serviceIndex = 0;\n _this.index = -1;\n _this.cellKeyDown = function (event, column) {\n if (event.isDefaultPrevented()) {\n return;\n }\n if (event.keyCode === Keys.enter) {\n _this.cellClick(event, column);\n }\n };\n _this.cells = function (rowIndexes) { return rowIndexes.map(function (columnIndex) {\n var column = _this.props.columns[columnIndex];\n var sortable = _this.props.sortable && column.sortable;\n var sortIndex = _this.props.sort ? _this.props.sort.findIndex(function (s) { return s.field === column.field; }) : -1;\n var sortDir = sortIndex >= 0 ? ((_this.props.sort)[sortIndex].dir || 'none') : 'none';\n var columnMenu = (column.columnMenu === null) ? null : (column.columnMenu || _this.props.columnMenu);\n var className = classNames({\n 'k-first': column.kFirst,\n 'k-filterable': Boolean(columnMenu),\n 'k-table-th': true,\n 'k-header': true,\n 'k-grid-header-sticky': column.locked,\n 'k-sorted': _this.props.sort && _this.props.sort.some(function (descriptor) { return descriptor.field === column.field; })\n }, column.headerClassName);\n var style = column.left !== undefined\n ? !_this.props.isRtl\n ? { left: column.left, right: column.right }\n : { left: column.right, right: column.left }\n : {};\n var sortLabel = intl(_this).toLanguageString(sortAriaLabel, messages[sortAriaLabel]);\n var ariaAttrs = column.isAccessible ? {\n ariaSort: ariaSortMap[sortDir],\n role: 'columnheader',\n ariaColumnIndex: column.ariaColumnIndex,\n ariaSelected: false,\n ariaDescription: sortable ? sortLabel : ''\n } : {\n 'role': 'presentation'\n };\n var key = (column.declarationIndex >= 0) ? ++_this.index : --_this.serviceIndex;\n var HeaderCell = column.headerCell ? column.headerCell : GridHeaderCell;\n var headerCell = (React.createElement(HeaderCell, { key: 1, field: column.field, onClick: sortable && (function (e) { return _this.cellClick(e, column); }) || undefined, selectionChange: _this.props.selectionChange, title: column.title, selectionValue: column.headerSelectionValue, render: _this.props.cellRender, children: _this.sortIcon(sortIndex), columnMenuWrapperProps: {\n column: {\n field: column.field,\n title: column.title,\n locked: column.locked,\n filter: column.filter\n },\n sortable: sortable && _this.props.sortable,\n sort: _this.props.sort,\n onSortChange: _this.props.sortChange,\n filter: _this.props.filter,\n filterable: _this.props.filterable && column.filterable,\n filterOperators: _this.props.filterOperators,\n onFilterChange: _this.props.filterChange,\n group: _this.props.group,\n groupable: _this.props.groupable,\n onGroupChange: _this.props.groupChange,\n columnMenu: columnMenu\n } }));\n var thProps = __assign(__assign({}, ariaAttrs), { key: key, colSpan: column.colSpan, rowSpan: column.rowSpan, className: className, style: style, columnId: column.id, navigatable: column.navigatable, onKeyDown: sortable && (function (e) { return _this.cellKeyDown(e, column); }) || undefined, role: 'columnheader' });\n var content = [\n headerCell,\n (_this.props.columnResize && _this.props.columnResize.resizable && column.resizable\n && React.createElement(ColumnResizer, { key: 2, resize: function (e, element, end) {\n return _this.props.columnResize &&\n _this.props.columnResize.dragHandler(e, column, element, end);\n }, autofit: function (e) {\n return _this.props.columnResize &&\n _this.props.columnResize.dblClickHandler(e, [column.id]);\n } }))\n ];\n var customCells = resolveCells(_this.props.cells, column.cells);\n if (customCells && customCells.headerCell) {\n var CustomCell = customCells.headerCell;\n return (React.createElement(CustomCell, { key: key, thProps: thProps, index: columnIndex }, content));\n }\n return (React.createElement(HeaderThElement, __assign({}, thProps, { key: key }), content));\n }); };\n _this.cellClick = _this.cellClick.bind(_this);\n return _this;\n }\n HeaderRow.prototype.cellClick = function (e, column) {\n e.preventDefault();\n if (!this.props.sortChange) {\n return;\n }\n var _a = normalize(this.props.sortable || false, column.sortable || false), allowUnsort = _a.allowUnsort, mode = _a.mode;\n var oldDescriptor = (this.props.sort || []).filter(function (d) { return d.field === column.field; })[0];\n var dir = sortSeqMap[allowUnsort][oldDescriptor && oldDescriptor.dir || ''];\n var newDescriptor = (mode === 'single') ?\n [] : (this.props.sort || []).filter(function (d) { return d.field !== column.field; });\n if (dir !== '' && column.field) {\n newDescriptor.push({ field: column.field, dir: dir });\n }\n this.props.sortChange(newDescriptor, e);\n };\n HeaderRow.prototype.sortIcon = function (sortIndex) {\n if (!this.props.sort) {\n return null;\n }\n return sortIndex >= 0 && [\n React.createElement(\"span\", { key: 1, className: 'k-sort-icon' },\n React.createElement(IconWrap, { name: 'sort-' + this.props.sort[sortIndex].dir + '-small', icon: this.props.sort[sortIndex].dir === 'asc' ? sortAscSmallIcon : sortDescSmallIcon })),\n this.props.sort.length > 1 &&\n React.createElement(\"span\", { key: 2, className: 'k-sort-icon' },\n React.createElement(\"span\", { className: \"k-sort-order\" }, sortIndex + 1))\n ];\n };\n HeaderRow.prototype.render = function () {\n var _this = this;\n this.serviceIndex = 0;\n this.index = -1;\n return this.props.columnsMap.map(function (rowIndexes, i) {\n return _this.props.pressHandler && (React.createElement(ColumnDraggable, { key: i, pressHandler: _this.props.pressHandler, dragHandler: _this.props.dragHandler, releaseHandler: _this.props.releaseHandler, ariaRowIndex: i + 1, dragClue: _this.props.dragClue, headerRef: _this.props.headerRef, containerRef: _this.props.containerRef }, _this.cells(rowIndexes))) || React.createElement(\"tr\", { className: 'k-table-row', role: \"row\", \"aria-rowindex\": i + 1 }, _this.cells(rowIndexes));\n });\n };\n return HeaderRow;\n}(React.Component));\nexport { HeaderRow };\nregisterForLocalization(HeaderRow);\n","import { messages } from './messages';\n/**\n * @hidden\n */\nexport var filterLogicList = [\n { text: 'grid.filterAndLogic', operator: 'and' },\n { text: 'grid.filterOrLogic', operator: 'or' }\n];\n/**\n * @hidden\n */\nexport var operators = {\n 'text': [\n { text: 'grid.filterContainsOperator', operator: 'contains' },\n { text: 'grid.filterNotContainsOperator', operator: 'doesnotcontain' },\n { text: 'grid.filterEqOperator', operator: 'eq' },\n { text: 'grid.filterNotEqOperator', operator: 'neq' },\n { text: 'grid.filterStartsWithOperator', operator: 'startswith' },\n { text: 'grid.filterEndsWithOperator', operator: 'endswith' },\n { text: 'grid.filterIsNullOperator', operator: 'isnull' },\n { text: 'grid.filterIsNotNullOperator', operator: 'isnotnull' },\n { text: 'grid.filterIsEmptyOperator', operator: 'isempty' },\n { text: 'grid.filterIsNotEmptyOperator', operator: 'isnotempty' }\n ],\n 'numeric': [\n { text: 'grid.filterEqOperator', operator: 'eq' },\n { text: 'grid.filterNotEqOperator', operator: 'neq' },\n { text: 'grid.filterGteOperator', operator: 'gte' },\n { text: 'grid.filterGtOperator', operator: 'gt' },\n { text: 'grid.filterLteOperator', operator: 'lte' },\n { text: 'grid.filterLtOperator', operator: 'lt' },\n { text: 'grid.filterIsNullOperator', operator: 'isnull' },\n { text: 'grid.filterIsNotNullOperator', operator: 'isnotnull' }\n ],\n 'date': [\n { text: 'grid.filterEqOperator', operator: 'eq' },\n { text: 'grid.filterNotEqOperator', operator: 'neq' },\n { text: 'grid.filterAfterOrEqualOperator', operator: 'gte' },\n { text: 'grid.filterAfterOperator', operator: 'gt' },\n { text: 'grid.filterBeforeOperator', operator: 'lt' },\n { text: 'grid.filterBeforeOrEqualOperator', operator: 'lte' },\n { text: 'grid.filterIsNullOperator', operator: 'isnull' },\n { text: 'grid.filterIsNotNullOperator', operator: 'isnotnull' }\n ],\n 'boolean': [\n { text: 'grid.filterEqOperator', operator: 'eq' }\n ]\n};\n/**\n * @hidden\n */\nexport var IsUnaryFilter = function (operator) {\n return operator === 'isnull' || operator === 'isnotnull' || operator === 'isempty' || operator === 'isnotempty';\n};\n/**\n * @hidden\n */\nexport var operatorMap = function (iterable, service) { return iterable.map(function (operator) { return ({\n text: service.toLanguageString(operator.text, messages[operator.text]),\n operator: operator.operator\n}); }); };\n/**\n * @hidden\n */\nexport var defaultBooleanOperator = 'eq';\n/**\n * @hidden\n */\nexport var booleanFilterValues = [\n { text: 'grid.filterBooleanAll', operator: '' },\n { text: 'grid.filterIsTrue', operator: true },\n { text: 'grid.filterIsFalse', operator: false }\n];\n/**\n * @hidden\n */\nexport var defaultHideSecondFilter = {\n text: false,\n numeric: false,\n date: false,\n boolean: true\n};\n/**\n * @hidden\n */\nexport var cellInputChange = function (value, e, props) {\n var defaultOperator = getDefaultOperator(props.operators);\n var operator = props.operator;\n switch (props.filterType) {\n case 'numeric':\n if (!operator || IsUnaryFilter(operator)) {\n // change the operator to default\n operator = defaultOperator;\n }\n if (value === null && operator === defaultOperator) {\n // clear only the default operator\n operator = '';\n }\n break;\n case 'date':\n if (!operator || IsUnaryFilter(operator)) {\n operator = defaultOperator;\n }\n if (value === null && operator === defaultOperator) {\n operator = '';\n }\n break;\n case 'text':\n if (!operator || IsUnaryFilter(operator)) {\n operator = defaultOperator;\n }\n if (!value && operator === defaultOperator) {\n operator = '';\n }\n break;\n default: return;\n }\n props.onChange({ value: value, operator: operator, syntheticEvent: e });\n};\n/**\n * @hidden\n */\nexport var getDefaultOperator = function (filterOperators, filterType) {\n if (filterType) {\n return filterOperators[filterType][0].operator;\n }\n else {\n return filterOperators[0].operator;\n }\n};\n/**\n * @hidden\n */\nexport var getFilterType = function (filterType) {\n return filterType || 'text';\n};\n/**\n * @hidden\n */\nexport var cellBoolDropdownChange = function (event, onChange) {\n var item = event.target.value;\n onChange({\n value: item.operator,\n operator: item.operator === '' ? '' : defaultBooleanOperator,\n syntheticEvent: event.syntheticEvent\n });\n};\n/**\n * @hidden\n */\nexport var cellOperatorChange = function (event, currentValue, onChange) {\n var value = currentValue;\n var item = event.target.value;\n if (!event.target.state.opened) {\n return;\n }\n if (IsUnaryFilter(item.operator)) {\n // clear the value to avoid confusion on what is filtered\n value = null;\n }\n if (currentValue === null && !IsUnaryFilter(item.operator)) {\n value = undefined;\n }\n onChange({ value: value, operator: item.operator, syntheticEvent: event.syntheticEvent });\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { Button } from '@progress/kendo-react-buttons';\nimport { DropDownList } from '@progress/kendo-react-dropdowns';\nimport { NumericTextBox, TextBox } from '@progress/kendo-react-inputs';\nimport { DatePicker } from '@progress/kendo-react-dateinputs';\nimport { messages, filterClearButton, filterChooseOperator } from '../messages';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { filterClearIcon, filterIcon } from '@progress/kendo-svg-icons';\nimport { cellBoolDropdownChange, cellInputChange, cellOperatorChange } from '../filterCommon';\nimport { classNames } from '@progress/kendo-react-common';\nvar GridFilterCell = /** @class */ (function (_super) {\n __extends(GridFilterCell, _super);\n function GridFilterCell(props) {\n var _this = _super.call(this, props) || this;\n _this.renderOperatorEditor = function (localization) {\n if (_this.props.filterType === 'boolean') {\n return;\n }\n var value = _this.props.operators.find(function (item) { return item.operator === _this.props.operator; }) || null;\n return (React.createElement(DropDownList, { size: _this.props.size, value: value, onChange: _this.operatorChange, className: \"k-dropdown-operator\", iconClassName: \"k-i-filter k-icon\", svgIcon: filterIcon, data: _this.props.operators, textField: \"text\", title: localization.toLanguageString(filterChooseOperator, messages[filterChooseOperator]), popupSettings: {\n width: ''\n } }));\n };\n _this.inputChange = _this.inputChange.bind(_this);\n _this.clear = _this.clear.bind(_this);\n _this.operatorChange = _this.operatorChange.bind(_this);\n _this.boolDropdownChange = _this.boolDropdownChange.bind(_this);\n return _this;\n }\n /**\n * @hidden\n */\n GridFilterCell.prototype.render = function () {\n var _a;\n var localizationService = provideLocalizationService(this);\n var defaultRendering = (React.createElement(\"div\", { className: \"k-filtercell\" },\n React.createElement(\"div\", { className: \"k-filtercell-wrapper\" },\n this.filterComponent(this.props.filterType, this.props.value, this.props.booleanValues),\n React.createElement(\"div\", { className: \"k-filtercell-operator\" },\n this.renderOperatorEditor(localizationService),\n \"\\u00A0\",\n React.createElement(Button, { size: this.props.size, icon: 'filter-clear', svgIcon: filterClearIcon, className: classNames((_a = {},\n _a['k-clear-button-visible'] = Boolean(!(this.props.value === null || this.props.value === '') || this.props.operator),\n _a)), title: localizationService.toLanguageString(filterClearButton, messages[filterClearButton]), type: \"button\", onClick: this.clear, disabled: !(!(this.props.value === null || this.props.value === '') || this.props.operator) })))));\n if (this.props.render) {\n return this.props.render.call(undefined, defaultRendering, this.props);\n }\n return defaultRendering;\n };\n GridFilterCell.prototype.inputChange = function (value, e) {\n cellInputChange(value, e, this.props);\n };\n GridFilterCell.prototype.operatorChange = function (event) {\n cellOperatorChange(event, this.props.value, this.props.onChange);\n };\n GridFilterCell.prototype.boolDropdownChange = function (event) {\n cellBoolDropdownChange(event, this.props.onChange);\n };\n GridFilterCell.prototype.clear = function (e) {\n e.preventDefault();\n this.props.onChange({ value: '', operator: '', syntheticEvent: e });\n };\n GridFilterCell.prototype.filterComponent = function (filterType, value, booleanValues) {\n var _this = this;\n switch (filterType) {\n case 'numeric':\n return (React.createElement(NumericTextBox, { size: this.props.size, value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));\n case 'date':\n return (React.createElement(DatePicker, { size: this.props.size, value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));\n case 'boolean':\n var noFilterSet_1 = function (filter) { return filter === null || filter === undefined; };\n return (React.createElement(DropDownList, { size: this.props.size, onChange: this.boolDropdownChange, value: booleanValues.find(function (item) { return item.operator === (noFilterSet_1(value) ? '' : value); }), data: booleanValues, textField: \"text\", title: this.props.title, ariaLabel: this.props.ariaLabel }));\n default: return (React.createElement(TextBox, { size: this.props.size, value: value || '', onChange: function (e) { _this.inputChange(e.target.value, e.syntheticEvent); }, title: this.props.title, \"aria-label\": this.props.ariaLabel }));\n }\n };\n return GridFilterCell;\n}(React.Component));\nexport { GridFilterCell };\nregisterForLocalization(GridFilterCell);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';\nimport { GridFilterCell } from '../cells/GridFilterCell';\nimport { operatorMap, booleanFilterValues, getFilterType } from '../filterCommon';\nimport { tableKeyboardNavigationTools as navigationTools, HeaderThElement } from '@progress/kendo-react-data-tools';\nimport { filterAriaLabel, messages } from '../messages';\nimport { classNames } from '@progress/kendo-react-common';\nimport { resolveCells } from '../utils';\n/**\n * @hidden\n */\nexport var FILTER_ROW_CLASS = 'k-table-row k-filter-row';\n/**\n *\n * @hidden\n */\nvar FilterRow = /** @class */ (function (_super) {\n __extends(FilterRow, _super);\n function FilterRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterRow.prototype.headerCellClassName = function (field, locked) {\n var result = \"\".concat(locked ? 'k-grid-header-sticky' : '');\n if (this.props.sort &&\n this.props.sort.filter(function (descriptor) { return descriptor.field === field; }).length > 0) {\n result += ' k-sorted';\n }\n return result;\n };\n FilterRow.prototype.setFilter = function (value, operator, field, e) {\n if (!this.props.filterChange) {\n return;\n }\n var filters = [];\n if (value !== '' && value !== null || operator !== '') {\n filters.push({\n field: field,\n operator: operator,\n value: value\n });\n }\n if (this.props.filter && this.props.filter.filters) {\n var oldFilters = this.props.filter.filters || [];\n oldFilters.forEach(function (filter) {\n var descriptor = filter;\n if (descriptor && descriptor.field !== field) {\n filters.push(descriptor);\n }\n });\n }\n var logic = this.props.filter && this.props.filter.logic ? this.props.filter.logic : 'and';\n this.props.filterChange(filters.length > 0 ? { logic: logic, filters: filters } : null, e);\n };\n FilterRow.prototype.render = function () {\n var _this = this;\n var intl = provideLocalizationService(this);\n var oldFilters = this.props.filter && this.props.filter.filters || [];\n var activeFilter = function (field) {\n if (field === undefined) {\n return;\n }\n var currentFilters = oldFilters.filter(function (filter) { return filter.field === field; });\n return currentFilters.length ? currentFilters[0] : undefined;\n };\n var serviceIndex = 0, index = -1;\n var filterCells = this.props.columns.filter(function (c) { return c.children.length === 0; })\n .map(function (column) {\n var filterType = getFilterType(column.filter);\n var currentActiveFilter = activeFilter(column.field);\n var ariaLabel = column.filterable ? intl.toLanguageString(filterAriaLabel, messages[filterAriaLabel]) : undefined;\n var value = currentActiveFilter && currentActiveFilter.value;\n if (value === undefined) {\n value = filterType === 'text' ? '' : null;\n }\n var filterCellProps = column.filterable && {\n render: _this.props.cellRender,\n field: column.field,\n title: column.filterTitle,\n value: value,\n operator: currentActiveFilter && currentActiveFilter.operator,\n operators: operatorMap(_this.props.filterOperators[filterType] || [], intl),\n booleanValues: operatorMap(booleanFilterValues, intl),\n filterType: filterType,\n ariaLabel: ariaLabel,\n onChange: function (e) { _this.setFilter(e.value, e.operator, column.field, e.syntheticEvent); }\n };\n var key = (column.declarationIndex >= 0) ? ++index : --serviceIndex;\n var ariaAttrs = {\n ariaLabel: ariaLabel,\n ariaColumnIndex: column.ariaColumnIndex\n };\n var style = column.left !== undefined\n ? !_this.props.isRtl\n ? { left: column.left, right: column.right }\n : { left: column.right, right: column.left }\n : {};\n var thProps = __assign({ columnId: navigationTools.getFilterColumnId(column.id), navigatable: column.navigatable, style: style, className: classNames('k-table-th', _this.headerCellClassName(column.field, column.locked) || undefined), role: 'columnheader' }, ariaAttrs);\n var content = (filterCellProps && (column.filterCell ?\n React.createElement(column.filterCell, __assign({}, filterCellProps)) :\n React.createElement(GridFilterCell, __assign({ size: _this.props.size }, filterCellProps))));\n var customCells = resolveCells(_this.props.cells, column.cells);\n if (customCells && customCells.filterCell) {\n var CustomCell = customCells.filterCell;\n return (React.createElement(CustomCell, __assign({ key: key }, filterCellProps, { thProps: thProps, index: index }), content));\n }\n return (React.createElement(HeaderThElement, __assign({ key: key }, thProps), content));\n });\n return React.createElement(\"tr\", { className: FILTER_ROW_CLASS, \"aria-rowindex\": this.props.ariaRowIndex, role: \"row\" }, filterCells);\n };\n return FilterRow;\n}(React.Component));\nexport { FilterRow };\nregisterForLocalization(FilterRow);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { Draggable, IconWrap } from '@progress/kendo-react-common';\nimport { registerForLocalization } from '@progress/kendo-react-intl';\nimport { sortAscSmallIcon, sortDescSmallIcon, xCircleIcon } from '@progress/kendo-svg-icons';\n/**\n * @hidden\n */\nvar GroupingIndicator = /** @class */ (function (_super) {\n __extends(GroupingIndicator, _super);\n function GroupingIndicator() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.draggable = null;\n /**\n * @hidden\n */\n _this.onPress = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.onPress) {\n _this.props.onPress(data.event, element);\n }\n };\n /**\n * @hidden\n */\n _this.onDrag = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.onDrag) {\n _this.props.onDrag(data.event, element);\n }\n };\n /**\n * @hidden\n */\n _this.onRelease = function (data) {\n var element = _this.draggable && _this.draggable.element;\n if (element && _this.props.onRelease) {\n _this.props.onRelease(data.event);\n }\n };\n _this.sortChange = function (event) {\n event.preventDefault();\n if (_this.props.onSortChange) {\n var sort = (_this.props.dir === 'asc') ? 'desc' : 'asc';\n _this.props.onSortChange(event, sort);\n }\n };\n _this.groupRemove = function (event) {\n event.preventDefault();\n event.stopPropagation();\n if (_this.props.onRemove) {\n _this.props.onRemove(event);\n }\n };\n return _this;\n }\n GroupingIndicator.prototype.render = function () {\n var _this = this;\n var dir = this.props.dir;\n return (React.createElement(Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { _this.draggable = component; } },\n React.createElement(\"div\", { className: \"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md\", onClick: this.sortChange, role: \"button\", style: { touchAction: 'none' } },\n React.createElement(\"span\", null,\n React.createElement(IconWrap, { name: 'sort-' + dir + '-small', icon: dir === 'asc' ? sortAscSmallIcon : sortDescSmallIcon, size: 'small' })),\n React.createElement(\"span\", { className: 'k-chip-content' }, this.props.title),\n React.createElement(\"span\", { className: \"k-chip-actions\" },\n React.createElement(\"span\", { className: \"k-chip-action k-chip-remove-action\", onClick: this.groupRemove },\n React.createElement(IconWrap, { name: 'x-circle', icon: xCircleIcon, size: 'small' }))))));\n };\n return GroupingIndicator;\n}(React.Component));\nexport { GroupingIndicator };\nregisterForLocalization(GroupingIndicator);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { GroupingIndicator } from '../drag/GroupingIndicator';\nimport { registerForLocalization, provideLocalizationService as intl } from '@progress/kendo-react-intl';\nimport { messages, groupPanelEmpty as messageKey, groupPanelAriaLabel } from './../messages';\n/**\n * @hidden\n */\nvar GroupPanel = /** @class */ (function (_super) {\n __extends(GroupPanel, _super);\n function GroupPanel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onGroupRemove = function (event, index) {\n var newGroups = _this.props.group.slice();\n newGroups.splice(index, 1);\n _this.props.groupChange(newGroups, event);\n };\n _this.onGroupSortChange = function (event, index, groupDesc, dir) {\n var group = Object.assign({}, groupDesc, { dir: dir });\n var newGroups = _this.props.group.slice();\n newGroups.splice(index, 1, group);\n _this.props.groupChange(newGroups, event);\n };\n return _this;\n }\n GroupPanel.prototype.render = function () {\n var _this = this;\n var groupsProp = this.props.group || [];\n var groups = groupsProp.map(function (groupDesc, index) { return (React.createElement(GroupingIndicator, { key: index, dir: groupDesc.dir || 'asc', title: _this.props.resolveTitle(groupDesc.field), onRemove: function (event) {\n _this.onGroupRemove(event, index);\n }, onSortChange: function (event, dir) {\n _this.onGroupSortChange(event, index, groupDesc, dir);\n }, onPress: _this.props.pressHandler, onDrag: _this.props.dragHandler, onRelease: _this.props.releaseHandler })); });\n return (React.createElement(\"div\", { ref: this.props.refCallback, className: \"k-grouping-header\", role: \"toolbar\", \"aria-label\": intl(this).toLanguageString(groupPanelAriaLabel, messages[groupPanelAriaLabel]), \"aria-controls\": this.props.ariaControls || '' },\n React.createElement(\"div\", { className: \"k-chip-list k-chip-list-md\", role: \"none\" }, groups),\n React.createElement(\"div\", { className: \"k-grouping-drop-container\" },\n !groups.length && intl(this).toLanguageString(messageKey, messages[messageKey]),\n \"\\u00A0\")));\n };\n return GroupPanel;\n}(React.Component));\nexport { GroupPanel };\nregisterForLocalization(GroupPanel);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { getScrollbarWidth } from '@progress/kendo-react-common';\nimport * as React from 'react';\nimport { classNames, kendoThemeMaps } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar Footer = /** @class */ (function (_super) {\n __extends(Footer, _super);\n function Footer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.footerWrap = null;\n _this.table = null;\n _this.scrollbarWidth = getScrollbarWidth();\n return _this;\n }\n Footer.prototype.componentDidMount = function () {\n this.setState({});\n };\n /**\n *\n * @param scrollLeft - Scrolls to the left (in pixels).\n */\n Footer.prototype.setScrollLeft = function (scrollLeft) {\n if (this.footerWrap) {\n this.footerWrap.scrollLeft = scrollLeft;\n }\n };\n /**\n *\n * @param width - Scrolls the width (in pixels).\n */\n Footer.prototype.setWidth = function (width) {\n if (this.table) {\n this.table.style.width = width + 'px';\n }\n };\n Footer.prototype.render = function () {\n var _a;\n var _this = this;\n if (!this.props.staticHeaders) {\n return (React.createElement(\"tfoot\", { className: \"k-table-tfoot\" }, this.props.row));\n }\n return (React.createElement(\"div\", { className: \"k-grid-footer\", role: \"presentation\" },\n React.createElement(\"div\", { ref: function (div) { _this.footerWrap = div; }, className: \"k-grid-footer-wrap\", style: this.scrollbarWidth ? {} : { borderWidth: 0 }, role: \"presentation\" },\n React.createElement(\"table\", { ref: function (table) { _this.table = table; }, className: classNames('k-table k-grid-footer-table', (_a = {\n 'k-table-md': !this.props.size\n },\n _a[\"k-table-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _a), this.props.className), role: \"presentation\" },\n React.createElement(\"colgroup\", { ref: function (e) { _this.props.columnResize.colGroupFooter = e; }, role: \"presentation\" }, this.props.cols),\n React.createElement(\"tfoot\", { className: \"k-table-tfoot\", role: \"presentation\" }, this.props.row)))));\n };\n return Footer;\n}(React.Component));\nexport { Footer };\n","import * as React from 'react';\n/**\n * @hidden\n */\nvar VirtualScroll = /** @class */ (function () {\n function VirtualScroll(cached) {\n var _this = this;\n this.table = null;\n this.containerHeight = 0;\n this.topCacheCount = 0; // 4;\n this.attendedSkip = 0; // -4;\n this.propsSkip = 0;\n this.total = 0;\n this.scrollableVirtual = false;\n this.realSkip = 0;\n this.pageSize = 0;\n this.PageChange = null;\n this.tableBodyRef = React.createRef();\n this.fixedScroll = false;\n this.askedSkip = undefined;\n this.containerRef = React.createRef();\n this.tableTransform = '';\n this.prevScrollPos = 0;\n this.tableTranslate = 0;\n this.scrollSyncing = false;\n this.reactVersion = Number.parseFloat(React.version);\n this.topItems = function (heights, skipTopBuffer) {\n if (!_this.container || skipTopBuffer) {\n return { topItemsCount: 0, topItemsHeight: 0 };\n }\n var screenHeight = _this.container.clientHeight;\n var itemsOnScreen = Math.ceil(screenHeight / heights[0].line);\n var topItemsCount = Math.ceil((heights.length - itemsOnScreen) / 2);\n var topItemsHeight = 0;\n for (var i = 0; i < topItemsCount; i++) {\n topItemsHeight += heights[i].line + heights[i].acc;\n }\n return {\n topItemsCount: topItemsCount,\n topItemsHeight: topItemsHeight,\n itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2\n };\n };\n this.horizontalScrollbarHeight = function () {\n if (!_this.container) {\n return 0;\n }\n return _this.container.offsetHeight - _this.container.clientHeight;\n };\n if (cached) {\n this.topCacheCount = 4;\n this.attendedSkip = -this.topCacheCount;\n }\n this.scrollHandler = this.scrollHandler.bind(this);\n }\n Object.defineProperty(VirtualScroll.prototype, \"container\", {\n get: function () {\n return this.containerRef.current;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(VirtualScroll.prototype, \"rowHeights\", {\n /**\n * @return - The row heights in an array.\n */\n get: function () {\n var result = [];\n var allRows = this.tableBodyRef.current && this.tableBodyRef.current.children || [];\n var accumulate = 0;\n for (var i = 0; i < allRows.length; i++) {\n if (allRows[i].className.indexOf('k-grouping-row') > -1) {\n accumulate += allRows[i].scrollHeight;\n continue;\n }\n if (allRows[i].className.indexOf('k-detail-row') > -1) {\n result[result.length - 1].line += allRows[i].scrollHeight;\n }\n else {\n result.push({\n line: allRows[i].scrollHeight,\n acc: accumulate\n });\n accumulate = 0;\n }\n }\n return result;\n },\n enumerable: false,\n configurable: true\n });\n VirtualScroll.prototype.changePage = function (skip, e) {\n this.attendedSkip = skip - this.topCacheCount;\n if (this.PageChange) {\n this.PageChange({\n skip: Math.max(0, skip - this.topCacheCount),\n take: this.pageSize\n }, e);\n }\n };\n VirtualScroll.prototype.translate = function (dY, forceSet) {\n this.tableTranslate = dY;\n if (this.scrollableVirtual && this.table) {\n if (this.reactVersion <= 17 || forceSet) {\n this.table.style.transform = 'translateY(' + dY + 'px)';\n }\n else {\n this.tableTransform = 'translateY(' + dY + 'px)';\n }\n }\n };\n VirtualScroll.prototype.reset = function () {\n this.scrollSyncing = true;\n if (this.fixedScroll) {\n return;\n }\n if (this.container) {\n this.container.scrollTop = 0;\n }\n this.translate(0, true);\n };\n VirtualScroll.prototype.localScrollUp = function (e) {\n if (!this.container) {\n return;\n }\n var heights = this.rowHeights;\n var scrollTop = this.container.scrollTop;\n var targetTranslate = this.tableTranslate;\n var rowsCount = 0;\n var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;\n var additionalOnTop = scrollTop - targetTranslate;\n if ((additionalOnTop > topItemsHeight) || heights.length <= itemsNeededOnScreen) {\n return;\n }\n while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip + topItemsCount)\n && this.propsSkip - rowsCount > 0 &&\n !(targetTranslate + (heights[heights.length - 1 - rowsCount].line + heights[heights.length - 1 - rowsCount].acc) + additionalOnTop <= scrollTop)) {\n targetTranslate -= heights[heights.length - 1 - rowsCount].line +\n heights[heights.length - 1 - rowsCount].acc;\n rowsCount++;\n }\n if (rowsCount === 0 && this.topCacheCount === 0 && this.attendedSkip > 0) {\n // allows local scrolling up, when top caching is disabled\n // for variable heights 'topCacheCount' should be atleast 1 to avoid flickering\n targetTranslate = Math.max(targetTranslate - heights[0].line, 0);\n rowsCount = 1;\n }\n if (this.propsSkip - rowsCount <= 0 && targetTranslate > scrollTop) {\n this.translate(0);\n this.changePage(0, e);\n this.container.scrollTop = 0;\n return;\n }\n if (targetTranslate > scrollTop) {\n targetTranslate = scrollTop;\n // need to handle these cases\n // if the item height is not available:\n // floor the translate to beginning of the item in absolute value\n }\n if (targetTranslate !== this.tableTranslate) {\n this.translate(Math.max(0, targetTranslate - topItemsHeight));\n var nextSkip = Math.max(0, this.propsSkip - rowsCount - topItemsCount);\n this.changePage(nextSkip, e);\n }\n };\n VirtualScroll.prototype.localScrollDown = function (e) {\n if (!this.container) {\n return;\n }\n var heights = this.rowHeights;\n var scrollTop = this.container.scrollTop;\n var targetTranslate = this.tableTranslate;\n var rowsCount = 0;\n var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;\n while (rowsCount < heights.length - this.topCacheCount &&\n !(targetTranslate + heights[rowsCount].line + heights[rowsCount].acc > scrollTop)) {\n targetTranslate += heights[rowsCount].line + heights[rowsCount].acc;\n rowsCount++;\n }\n if ((topItemsCount > this.propsSkip + rowsCount) || heights.length <= itemsNeededOnScreen) {\n return;\n }\n if (rowsCount >= heights.length - this.topCacheCount && this.propsSkip + rowsCount >= this.total) {\n this.translate(targetTranslate - topItemsHeight);\n this.changePage(this.total - 1 - topItemsCount, e);\n }\n else if (targetTranslate !== this.tableTranslate && this.propsSkip + rowsCount - topItemsCount !== this.propsSkip) {\n this.translate(targetTranslate - topItemsHeight);\n this.changePage(this.propsSkip + rowsCount - topItemsCount, e);\n }\n };\n VirtualScroll.prototype.scrollNonStrict = function (e) {\n var floatRowIndex = this.total * this.prevScrollPos / (this.containerHeight);\n var rowIndex = Math.floor(floatRowIndex);\n if (rowIndex >= this.total) {\n rowIndex = this.total - 1;\n }\n var rowpercentage = Math.min(floatRowIndex - rowIndex, 1);\n var microAdjust = 0;\n var rowIndexOffset = rowIndex - this.propsSkip;\n var heights = this.rowHeights;\n if (rowIndexOffset >= 0 && rowIndexOffset <= 1) {\n microAdjust = -((heights[0].line + heights[0].acc) * rowpercentage);\n }\n else if (rowIndexOffset === -1) {\n microAdjust = -((heights[heights.length - 1].line + heights[heights.length - 1].acc) * rowpercentage);\n }\n var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight;\n this.translate(Math.max(0, microAdjust - topItemsHeight - this.horizontalScrollbarHeight() + this.containerHeight * floatRowIndex / this.total));\n this.changePage(rowIndex - topItemsCount, e);\n };\n VirtualScroll.prototype.scrollHandler = function (e) {\n if (!this.scrollableVirtual) {\n return;\n }\n if (this.scrollSyncing || !this.container || !this.table) {\n this.scrollSyncing = false;\n return;\n }\n var scrollTop = this.container.scrollTop;\n var prev = this.prevScrollPos;\n this.prevScrollPos = scrollTop;\n if (this.askedSkip !== undefined) {\n this.translate(this.containerHeight * this.askedSkip / this.total);\n this.changePage(this.askedSkip, e);\n this.prevScrollPos = scrollTop;\n this.askedSkip = undefined;\n return;\n }\n if (scrollTop - prev < 0 && scrollTop > this.tableTranslate - this.table.scrollHeight / 10) {\n this.localScrollUp(e);\n }\n else if (scrollTop - prev > 0 && scrollTop < this.tableTranslate + this.table.scrollHeight * 2 / 3) {\n this.localScrollDown(e);\n }\n else {\n this.scrollNonStrict(e);\n }\n this.prevScrollPos = scrollTop;\n };\n return VirtualScroll;\n}());\nexport { VirtualScroll };\n","import * as React from 'react';\n/**\n * @hidden\n */\nvar RowHeightService = /** @class */ (function () {\n function RowHeightService(total, rowHeight, detailRowHeight, data) {\n if (total === void 0) { total = 0; }\n this.total = total;\n this.offsets = [];\n this.heights = [];\n var agg = 0;\n for (var idx = 0; idx < total; idx++) {\n this.offsets.push(agg);\n var currHeight = (data && data[idx].expanded && data[idx].rowType === 'data') ? detailRowHeight : rowHeight;\n agg += currHeight;\n this.heights.push(currHeight);\n }\n }\n RowHeightService.prototype.height = function (rowIndex) {\n return this.heights[rowIndex];\n };\n RowHeightService.prototype.index = function (position) {\n if (position < 0) {\n return undefined;\n }\n var result = this.offsets.reduce(function (prev, current, idx) {\n if (prev !== undefined) {\n return prev;\n }\n else if (current === position) {\n return idx;\n }\n else if (current > position) {\n return idx - 1;\n }\n return undefined;\n }, undefined);\n return result === undefined ? this.total - 1 : result;\n };\n RowHeightService.prototype.offset = function (rowIndex) {\n return this.offsets[rowIndex];\n };\n RowHeightService.prototype.totalHeight = function () {\n var lastOffset = this.offsets[this.offsets.length - 1];\n var lastHeight = this.heights[this.heights.length - 1];\n return lastOffset + lastHeight;\n // return this.heights.reduce((prev, curr) => prev + curr, 0);\n };\n return RowHeightService;\n}());\nexport { RowHeightService };\n/**\n * @hidden\n */\nvar VirtualScrollFixed = /** @class */ (function () {\n function VirtualScrollFixed(_cached) {\n this.table = null;\n this.containerHeight = 0;\n this.topCacheCount = 0;\n this.attendedSkip = 0;\n this.propsSkip = 0;\n this.total = 0;\n this.scrollableVirtual = false;\n this.realSkip = 0;\n this.pageSize = 0;\n this.PageChange = null;\n this.tableBodyRef = React.createRef();\n this.fixedScroll = false;\n this.askedSkip = undefined;\n this.containerRef = React.createRef();\n this.tableTransform = '';\n this.scrollSyncing = false;\n this.lastLoaded = 0;\n this.firstLoaded = 0;\n this.lastScrollTop = 0;\n this.reactVersion = Number.parseFloat(React.version);\n this.firstLoaded = this.pageSize;\n this.lastLoaded = this.realSkip + this.pageSize;\n this.scrollHandler = this.scrollHandler.bind(this);\n }\n Object.defineProperty(VirtualScrollFixed.prototype, \"container\", {\n get: function () {\n return this.containerRef.current;\n },\n enumerable: false,\n configurable: true\n });\n VirtualScrollFixed.prototype.translate = function (dY, forceSet) {\n if (this.scrollableVirtual && this.table) {\n if (this.reactVersion <= 17 || forceSet) {\n this.table.style.transform = 'translateY(' + dY + 'px)';\n }\n else {\n this.tableTransform = 'translateY(' + dY + 'px)';\n }\n }\n };\n VirtualScrollFixed.prototype.changePage = function (skip, e) {\n if (this.PageChange) {\n this.PageChange({ skip: Math.max(0, skip), take: this.pageSize }, e);\n }\n };\n VirtualScrollFixed.prototype.reset = function () {\n this.scrollSyncing = true;\n if (this.fixedScroll) {\n return;\n }\n if (this.container) {\n this.container.scrollTop = 0;\n }\n this.translate(0, true);\n };\n VirtualScrollFixed.prototype.scrollHandler = function (e) {\n if (!this.scrollableVirtual || !this.container || !this.table ||\n !this.rowHeightService || !this.containerRef.current) {\n return;\n }\n if (this.scrollSyncing) {\n this.scrollSyncing = false;\n return;\n }\n var scrollTop = this.container.scrollTop;\n var up = this.lastScrollTop >= scrollTop;\n var down = !up;\n this.lastScrollTop = scrollTop;\n var firstItemIndex = this.rowHeightService.index(scrollTop);\n var firstItemOffset = this.rowHeightService.offset(firstItemIndex);\n var offsetHeight = this.containerRef.current.offsetHeight;\n var lastItemIndex = this.rowHeightService.index(scrollTop + offsetHeight);\n if (down && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {\n var overflow = (firstItemIndex + this.pageSize) - this.total;\n if (overflow > 0) {\n firstItemIndex = firstItemIndex - overflow;\n firstItemOffset = this.rowHeightService.offset(firstItemIndex);\n }\n this.firstLoaded = firstItemIndex;\n this.translate(firstItemOffset);\n var nextTake = this.firstLoaded + this.pageSize;\n this.lastLoaded = Math.min(nextTake, this.total);\n this.changePage(this.firstLoaded, e);\n }\n else if (up && firstItemIndex < this.firstLoaded) {\n var nonVisibleBuffer = Math.floor(this.pageSize * 0.3);\n this.firstLoaded = Math.max(firstItemIndex - nonVisibleBuffer, 0);\n this.translate(this.rowHeightService.offset(this.firstLoaded));\n this.lastLoaded = Math.min(this.firstLoaded + this.pageSize, this.total);\n this.changePage(this.firstLoaded, e);\n }\n };\n return VirtualScrollFixed;\n}());\nexport { VirtualScrollFixed };\n","// offsetWidth() is slowly transition to reporting double instead of integet in all browsers\n// during this process (which is a bit back-and-forth) we need to make sure we are working across all browsers and versions\nvar OFFSET_ROUND = 1;\nvar LOCK_COLUMN_BUFFER = 20;\n/**\n * @hidden\n */\nvar ColumnResize = /** @class */ (function () {\n function ColumnResize(triggerResize) {\n var _this = this;\n // Typings. `col` and `colgroup` do not differ, both represent a `HTMLTableColElement`.\n // Implemented as `any`.\n this.columns = [];\n /**\n * The settings for resizing the Grid.\n */\n this.resizable = false;\n this.isRtl = false;\n this.setIsRtl = function (isRtl) {\n _this.isRtl = isRtl;\n };\n this.dragHandler = function (event, column, dragCue, end) {\n var e = event.originalEvent;\n if (!end) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n var thElement = dragCue.closest('th');\n if (!thElement || !thElement) {\n return;\n }\n var oldWidth = thElement.clientWidth;\n var newWidth = oldWidth;\n if (_this.isRtl) {\n newWidth += (dragCue.getBoundingClientRect().right - (dragCue.offsetWidth / 2)) - event.clientX;\n }\n else {\n newWidth += event.clientX - dragCue.getBoundingClientRect().left - (dragCue.offsetWidth / 2);\n }\n if (!end && Math.abs(newWidth - oldWidth) < 1) {\n return;\n }\n _this.fixateInitialWidths(thElement.parentElement.clientWidth);\n _this.setWidths(column, Math.floor(newWidth) / oldWidth);\n var index = _this.columns.filter(function (c) { return !c.children.length; }).findIndex(function (c) { return c.id === column.id; });\n _this.onResize(index, oldWidth, newWidth, e, end, column.id);\n };\n this.dblClickHandler = function (event, columnIds) {\n var columns = _this.columns.filter(function (c) { return columnIds.indexOf(c.id) > -1; });\n if (!_this.colGroupMain || !columns.length) {\n return;\n }\n var leafsForAdjust = {};\n var stack = columns;\n while (stack.length > 0) {\n var currentCol = stack.pop();\n if (!currentCol) {\n break;\n }\n if (currentCol.children.length) {\n stack.push.apply(stack, currentCol.children);\n }\n else {\n leafsForAdjust[currentCol.id] = currentCol;\n }\n }\n var leafs = _this.columns.filter(function (c) { return !c.children.length; });\n var indexesForAdjust = [];\n leafs.forEach(function (currentColumn, index) {\n if (leafsForAdjust[currentColumn.id]) {\n indexesForAdjust.push(index);\n }\n });\n var tables = [_this.colGroupMain.parentElement];\n var colgroups = [_this.colGroupMain];\n if (_this.colGroupHeader) {\n tables.push(_this.colGroupHeader.parentElement);\n colgroups.push(_this.colGroupHeader);\n }\n if (_this.colGroupFooter) {\n tables.push(_this.colGroupFooter.parentElement);\n colgroups.push(_this.colGroupFooter);\n }\n tables.forEach(function (table) { return table.classList.add('k-autofitting'); });\n var maxWidths = [];\n colgroups.forEach(function (colgroup) {\n indexesForAdjust.forEach(function (columnIndex) {\n if (colgroup.children[columnIndex]) {\n colgroup.children[columnIndex].width = '';\n maxWidths[columnIndex] = Math.max(maxWidths[columnIndex] || 0, colgroup.children[columnIndex].offsetWidth + OFFSET_ROUND);\n }\n });\n });\n colgroups.forEach(function (colgroup) {\n indexesForAdjust.forEach(function (columnIndex) {\n if (colgroup.children[columnIndex]) {\n colgroup.children[columnIndex].width = maxWidths[columnIndex] + 'px';\n leafs[columnIndex].width = maxWidths[columnIndex];\n }\n });\n });\n tables.forEach(function (table) { return table.classList.remove('k-autofitting'); });\n _this.onResize(indexesForAdjust[0], 0, 0, event, true, columnIds[0]);\n };\n this.updateColElements = function (affectedColumns) {\n var leafColumns = _this.columns.filter(function (c) { return !c.children.length; });\n var difference = 1e-10;\n var _loop_1 = function (i) {\n var currentColumn = affectedColumns[i];\n var colIndex = leafColumns.findIndex(function (c) { return c.id === currentColumn.id; });\n var currentColumnFloatWidth = parseFloat((currentColumn.width || 0).toString());\n var currentColumnFloorWidth = Math.floor(currentColumnFloatWidth);\n difference += currentColumnFloatWidth - currentColumnFloorWidth;\n var currentWidth = currentColumnFloorWidth + Math.floor(difference);\n difference -= Math.floor(difference);\n if (_this.colGroupMain && _this.colGroupMain.children[colIndex]) {\n var mainWidth = parseInt(_this.colGroupMain.children[colIndex].width, 10);\n _this.colGroupMain.children[colIndex].width = currentWidth + 'px';\n _this.updateNextLockedCol(_this.colGroupMain.parentElement, currentColumn, mainWidth - currentWidth);\n }\n if (_this.colGroupHeader && _this.colGroupHeader.children[colIndex]) {\n var headerWidth = parseInt(_this.colGroupHeader.children[colIndex].width, 10);\n // static headers\n _this.colGroupHeader.children[colIndex].width = currentWidth + 'px';\n _this.updateNextLockedCol(_this.colGroupHeader.parentElement, currentColumn, headerWidth - currentWidth);\n }\n if (_this.colGroupFooter && _this.colGroupFooter.children[colIndex]) {\n var footerWidth = parseInt(_this.colGroupFooter.children[colIndex].width, 10);\n // static footers\n _this.colGroupFooter.children[colIndex].width = currentWidth + 'px';\n _this.updateNextLockedCol(_this.colGroupFooter.parentElement, currentColumn, footerWidth - currentWidth);\n }\n };\n for (var i = 0; i < affectedColumns.length; i++) {\n _loop_1(i);\n }\n };\n this.onResize = triggerResize;\n }\n ColumnResize.prototype.fixateInitialWidths = function (width) {\n var columns = this.columns.filter(function (c) { return !c.children.length; });\n var remainingCount = 0;\n var cols = this.colGroupMain ? this.colGroupMain.children : [];\n for (var i = 0; i < cols.length; i++) {\n if (cols[i].width) {\n width -= parseFloat(cols[i].width);\n }\n else {\n remainingCount++;\n }\n }\n if (remainingCount === 0) {\n return;\n }\n var perCol = Math.floor(width / remainingCount);\n for (var i = 0; i < cols.length; i++) {\n var col = cols[i];\n if (!col.width) {\n col.width = perCol;\n columns[i].width = perCol.toString();\n if (this.colGroupHeader) {\n this.colGroupHeader.children[i].width = perCol;\n }\n if (this.colGroupFooter) {\n this.colGroupFooter.children[i].width = perCol;\n }\n }\n }\n };\n ColumnResize.prototype.setWidths = function (column, coef) {\n var indexInOriginal = this.columns.findIndex(function (c) { return c.id === column.id; });\n var toAdjust = [];\n var more = column.children.length;\n for (var i = indexInOriginal + 1; more > 0 && i < this.columns.length; i++, more--) {\n var cc = this.columns[i];\n if (!cc.children.length) {\n toAdjust.push(cc);\n }\n else {\n more += cc.children.length;\n }\n }\n if (toAdjust.length === 0) {\n toAdjust.push(column);\n }\n toAdjust.forEach(function (colToAdjust) {\n var targetWidth = colToAdjust.width ? parseFloat(colToAdjust.width.toString()) * coef : 0;\n var min = colToAdjust.minResizableWidth === undefined ? 10 : colToAdjust.minResizableWidth;\n if (targetWidth < min) {\n targetWidth = min;\n }\n colToAdjust.width = targetWidth;\n });\n this.updateColElements(toAdjust);\n return toAdjust;\n };\n ColumnResize.prototype.updateNextLockedCol = function (element, current, deltaWidth) {\n var _this = this;\n var currentIndex = current.index;\n var gridWrapperEl = this.colGroupMain.parentElement.closest('.k-grid');\n var maxWidth = gridWrapperEl === null || gridWrapperEl === void 0 ? void 0 : gridWrapperEl.clientWidth;\n var widthOfLocked = this.columns.filter(function (c) { return c.locked; }).map(function (e) { return parseInt(e.width + '', 10); }).reduce(function (a, b) { return a + b; }, 0);\n if (!current.locked || maxWidth <= widthOfLocked + LOCK_COLUMN_BUFFER) {\n return;\n }\n this.columns.forEach(function (nColumn) {\n if ((nColumn === null || nColumn === void 0 ? void 0 : nColumn.locked) && deltaWidth) {\n var allColumnEls = element === null || element === void 0 ? void 0 : element.querySelectorAll('[aria-colindex=\"' + nColumn.ariaColumnIndex + '\"]');\n allColumnEls === null || allColumnEls === void 0 ? void 0 : allColumnEls.forEach(function (el) {\n var currentStyle = el.style;\n if (_this.isRtl) {\n if (nColumn.index > currentIndex && currentStyle && currentStyle.right) {\n currentStyle.right = parseInt(currentStyle.right, 10) - deltaWidth + 'px';\n }\n if (nColumn.index < currentIndex && currentStyle && currentStyle.left) {\n currentStyle.left = parseInt(currentStyle.left, 10) - deltaWidth + 'px';\n }\n }\n else {\n if (nColumn.index > currentIndex && currentStyle && currentStyle.left) {\n currentStyle.left = parseInt(currentStyle.left, 10) - deltaWidth + 'px';\n }\n if (nColumn.index < currentIndex && currentStyle && currentStyle.right) {\n currentStyle.right = parseInt(currentStyle.right, 10) - deltaWidth + 'px';\n }\n }\n });\n }\n });\n };\n return ColumnResize;\n}());\nexport { ColumnResize };\n","import * as React from 'react';\nimport { getIndex } from '@progress/kendo-react-data-tools';\n/**\n * @hidden\n */\nvar CommonDragLogic = /** @class */ (function () {\n function CommonDragLogic(columnReorder, groupReorder, columnToGroup) {\n var _this = this;\n this.refDragElementClue = React.createRef();\n this.refDropElementClue = React.createRef();\n this.columns = [];\n this.reorderable = false;\n this.groupable = false;\n this.startColumn = -1;\n this.startGroup = -1;\n this.currentColumn = -1;\n this.currentGroup = -1;\n this.groupPanelDivElement = null;\n this.refGroupPanelDiv = function (e) {\n _this.groupPanelDivElement = (e && e.children) ? e.children[0] : e;\n };\n this.pressHandler = function (event, element) {\n var startColumn = _this.getColumnIndex(event, element);\n _this.startGroup = _this.getGroupIndex(event);\n if (startColumn >= 0) {\n var col = _this.columns[startColumn];\n if (col.reorderable && _this.reorderable || col.groupable && _this.groupable) {\n _this.startColumn = startColumn;\n }\n }\n };\n this.dragHandler = function (event, element) {\n if (!event.isTouch) {\n event.originalEvent.preventDefault();\n }\n event.originalEvent.stopPropagation();\n if (_this.startColumn === -1 && _this.startGroup === -1) {\n return;\n }\n _this.currentColumn = _this.getColumnIndex(event, element);\n var groupPanelChildren = _this.groupPanelDivElement && _this.groupPanelDivElement.children;\n _this.currentGroup = _this.isTargetGroupingContainer(event)\n ? groupPanelChildren && groupPanelChildren.length\n ? groupPanelChildren.length\n : 0\n : _this.getGroupIndex(event);\n var invalidIndex = !_this.isValid();\n if (invalidIndex) {\n _this.currentColumn = -1;\n _this.currentGroup = -1;\n }\n var targetElement = (_this.currentColumn >= 0) ?\n element.children[_this.columns[_this.currentColumn].index] :\n _this.isTargetGroupingContainer(event)\n ? event.originalEvent.target\n : _this.groupPanelDivElement && _this.groupPanelDivElement.children[_this.currentGroup];\n _this.updateDragElementClue(event, element, targetElement, invalidIndex);\n _this.updateDropElementClue(event, element, targetElement, invalidIndex);\n };\n this.releaseHandler = function (event) {\n var prevColumnIndex = _this.startColumn;\n var nextColumnIndex = _this.currentColumn;\n var prevGroupIndex = _this.startGroup;\n var nextGroupIndex = _this.currentGroup;\n event.originalEvent.preventDefault();\n if (_this.dropElementClue) {\n _this.dropElementClue.setState({ visible: false });\n }\n if (_this.dragElementClue) {\n _this.dragElementClue.setState({ visible: false });\n }\n var isValid = _this.isValid();\n _this.startColumn = _this.startGroup = _this.currentColumn = _this.currentGroup = -1;\n if (!isValid) {\n return;\n }\n if (prevColumnIndex >= 0 && nextColumnIndex >= 0) {\n _this.columnReorder(prevColumnIndex, nextColumnIndex, event.originalEvent);\n }\n else if (prevGroupIndex >= 0 && nextGroupIndex >= 0) {\n _this.groupReorder(prevGroupIndex, nextGroupIndex, event.originalEvent);\n }\n else if (prevColumnIndex >= 0 && nextGroupIndex >= 0) {\n _this.columnToGroup(prevColumnIndex, nextGroupIndex, event.originalEvent);\n }\n };\n this.columnReorder = columnReorder;\n this.groupReorder = groupReorder;\n this.columnToGroup = columnToGroup;\n }\n Object.defineProperty(CommonDragLogic.prototype, \"dragClueRef\", {\n get: function () {\n return this.refDragElementClue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommonDragLogic.prototype, \"dropClueRef\", {\n get: function () {\n return this.refDropElementClue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommonDragLogic.prototype, \"dragElementClue\", {\n get: function () {\n return this.refDragElementClue.current;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommonDragLogic.prototype, \"dropElementClue\", {\n get: function () {\n return this.refDropElementClue.current;\n },\n enumerable: false,\n configurable: true\n });\n CommonDragLogic.prototype.getColumnIndex = function (event, parent) {\n if (!parent || (parent.parentElement === this.groupPanelDivElement)) {\n return -1;\n }\n var index = getIndex(event, parent);\n if (index === -1) {\n return -1;\n }\n var _loop_1 = function (i) {\n if (parent.parentNode.children[i] === parent) {\n return { value: this_1.columns.findIndex(function (c) { return ((c.index === index) && (c.depth === i)); }) };\n }\n };\n var this_1 = this;\n for (var i = 0; i < parent.parentNode.children.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n return -1;\n };\n CommonDragLogic.prototype.isTargetGroupingContainer = function (event) {\n var target = event.originalEvent.target;\n return target.className.indexOf\n ? target.className.indexOf('k-grouping-drop-container') !== -1\n : false;\n };\n CommonDragLogic.prototype.getGroupIndex = function (event) {\n return getIndex(event, this.groupPanelDivElement);\n };\n CommonDragLogic.prototype.isValid = function () {\n if (this.startGroup >= 0) {\n // group can be moved into group only\n return this.currentGroup >= 0 && this.currentGroup !== this.startGroup;\n }\n if (this.startColumn === -1) {\n return false;\n }\n if (this.currentGroup >= 0) {\n // column to group is possible\n return this.columns[this.startColumn].groupable === true && this.groupable === true;\n }\n // reorder is possible\n return this.reorderable === true &&\n this.currentColumn >= 0 &&\n this.currentColumn !== this.startColumn &&\n this.columns[this.startColumn].reorderable === true &&\n this.columns[this.currentColumn].parentIndex === this.columns[this.startColumn].parentIndex;\n };\n CommonDragLogic.prototype.updateDragElementClue = function (event, element, targetElement, invalidIndex) {\n if (!this.dragElementClue) {\n return;\n }\n var innerText = this.startColumn >= 0 ?\n element.children[this.columns[this.startColumn].index].innerText :\n element.innerText;\n this.dragElementClue.setState({\n visible: true,\n top: (event.pageY + 10),\n left: event.pageX,\n innerText: innerText,\n status: (invalidIndex || !targetElement) ? 'k-i-cancel' : 'k-i-plus'\n });\n };\n CommonDragLogic.prototype.updateDropElementClue = function (event, element, targetElement, invalidIndex) {\n if (!this.dropElementClue) {\n return;\n }\n if (invalidIndex || !targetElement) {\n this.dropElementClue.setState({ visible: false });\n return;\n }\n var rect = targetElement.getBoundingClientRect();\n var groupElement = targetElement.closest('.k-grouping-header');\n var rectParent = (groupElement || targetElement).getBoundingClientRect();\n var left = rect.left + event.pageX - event.clientX - 6;\n if (!this.isTargetGroupingContainer(event) && (this.currentColumn > this.startColumn\n || this.currentGroup > this.startGroup && this.startGroup !== -1)) {\n left += rect.width;\n }\n var top = rectParent.top + event.pageY - event.clientY;\n this.dropElementClue.setState({\n visible: true,\n top: top,\n left: left,\n height: (this.currentColumn >= 0) ? element.clientHeight : rectParent.height\n });\n };\n return CommonDragLogic;\n}());\nexport { CommonDragLogic };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { getNestedValue } from './../utils';\nimport { useInternationalization } from '@progress/kendo-react-intl';\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport { GRID_COL_INDEX_ATTRIBUTE } from '../constants';\nimport { classNames } from '@progress/kendo-react-common';\nexport var GridCell = function (props) {\n var _a;\n var defaultRendering = null;\n var intl = useInternationalization();\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n var onContextMenu = React.useCallback(function (event) {\n if (props.onContextMenu) {\n props.onContextMenu.call(undefined, event, props.dataItem, props.field);\n }\n }, [props.onContextMenu, props.dataItem, props.field]);\n var tdProps = null;\n var content = null;\n if (props.rowType === 'groupFooter') {\n tdProps = {\n onContextMenu: onContextMenu,\n className: props.className\n };\n defaultRendering = React.createElement(\"td\", __assign({}, tdProps));\n }\n else if (props.rowType !== 'groupHeader') {\n if (props.field !== undefined) {\n var data = getNestedValue(props.field, props.dataItem);\n if (data !== undefined && data !== null) {\n content = props.format ?\n intl.format(props.format, data) :\n data.toString();\n }\n }\n var className = classNames('k-table-td', props.className, { 'k-selected': props.isSelected });\n tdProps = __assign((_a = { onContextMenu: onContextMenu, colSpan: props.colSpan, style: props.style, className: className, role: 'gridcell', 'aria-colindex': props.ariaColumnIndex, 'aria-selected': props.isSelected }, _a[GRID_COL_INDEX_ATTRIBUTE] = props.columnIndex, _a), navigationAttributes);\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps), content));\n }\n var rowTypeSetting = props.rowType || 'data';\n var customCells = props.cells;\n if (customCells && customCells[rowTypeSetting]) {\n var CustomCell = customCells[rowTypeSetting];\n return (React.createElement(CustomCell, __assign({}, props, { tdProps: tdProps }), content));\n }\n return props.render ?\n props.render.call(undefined, defaultRendering, props) :\n defaultRendering;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { classNames, IconWrap, Keys } from '@progress/kendo-react-common';\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport { useLocalization } from '@progress/kendo-react-intl';\nimport { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';\nimport * as React from 'react';\nimport { messages, groupCollapse, groupExpand } from '../messages';\n/**\n * @hidden\n */\nexport var GridGroupCell = function (props) {\n var defaultRendering = null;\n var columnIndex = props.columnIndex, level = props.level, columnsCount = props.columnsCount, rowType = props.rowType, dataItem = props.dataItem, field = props.field, onChange = props.onChange, expanded = props.expanded, render = props.render, dataIndex = props.dataIndex, ariaColumnIndex = props.ariaColumnIndex, isRtl = props.isRtl;\n var definedField = field || '';\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n var localization = useLocalization();\n var tdProps = null;\n var td2Props = null;\n var content = null;\n var onKeyDownHandler = React.useCallback(function (event) {\n if (event.isDefaultPrevented()) {\n return;\n }\n if (event.keyCode === Keys.enter && onChange) {\n event.preventDefault();\n onChange({\n dataItem: dataItem,\n dataIndex: dataIndex,\n syntheticEvent: event,\n field: undefined,\n value: !expanded\n });\n }\n }, [expanded, onChange, dataItem, dataIndex]);\n var onContextMenu = React.useCallback(function (event) {\n if (props.onContextMenu) {\n props.onContextMenu.call(undefined, event, props.dataItem, props.field);\n }\n }, [props.onContextMenu, props.dataItem, props.field]);\n var renderCellCollapse = function (colspan, styles) {\n var _a;\n var baseMessage = expanded ? groupCollapse : groupExpand;\n var message = localization.toLanguageString(baseMessage, messages[baseMessage]);\n tdProps = __assign((_a = { className: 'k-table-td', style: __assign(__assign({}, props.style), styles), colSpan: colspan, key: 'g-colspan', role: 'gridcell' }, _a['aria-selected'] = false, _a['aria-expanded'] = expanded, _a['aria-colindex'] = ariaColumnIndex, _a.onKeyDown = onKeyDownHandler, _a.onContextMenu = onContextMenu, _a), navigationAttributes);\n content = (React.createElement(\"p\", { className: \"k-reset\" },\n React.createElement(\"a\", { onClick: function (e) {\n e.preventDefault();\n if (onChange) {\n onChange({\n dataItem: dataItem,\n dataIndex: dataIndex,\n syntheticEvent: e,\n field: undefined,\n value: !expanded\n });\n }\n }, href: \"#\", tabIndex: -1, \"aria-label\": message },\n React.createElement(IconWrap, { name: expanded ?\n 'caret-alt-down'\n : isRtl ? 'caret-alt-left' : 'caret-alt-right', icon: expanded ?\n caretAltDownIcon\n : isRtl ? caretAltLeftIcon : caretAltRightIcon })),\n ((dataItem[definedField] instanceof Date) && dataItem[definedField].toString) ?\n dataItem[definedField].toString() :\n dataItem[definedField]));\n return (React.createElement(\"td\", __assign({}, tdProps), content));\n };\n if (columnIndex === undefined || level === undefined || columnIndex < level ||\n columnsCount === undefined || rowType !== 'groupHeader' || dataItem[definedField] === undefined) {\n tdProps = {\n style: props.style,\n key: 'g' + columnIndex,\n className: classNames('k-table-td', 'k-group-cell', { 'k-grid-content-sticky': props.locked }),\n role: 'gridcell',\n onContextMenu: onContextMenu\n };\n defaultRendering = (React.createElement(\"td\", __assign({}, tdProps)));\n }\n else if (columnIndex <= level && !props.locked) {\n defaultRendering = renderCellCollapse(columnsCount - columnIndex, {});\n }\n else if (columnIndex <= level && props.locked) {\n td2Props = {\n className: 'k-table-td',\n role: 'gridcell',\n colSpan: (columnsCount - columnIndex),\n style: { borderLeftWidth: 0, borderRightWidth: 0 },\n onContextMenu: onContextMenu\n };\n defaultRendering = (React.createElement(React.Fragment, null,\n renderCellCollapse(0, { position: 'sticky', zIndex: 2 }),\n React.createElement(\"td\", __assign({}, td2Props))));\n }\n var rowTypeSetting = props.rowType || 'data';\n var customCells = props.cells;\n if (customCells && customCells.group\n && customCells.group[rowTypeSetting]) {\n var CustomCell = customCells.group[rowTypeSetting];\n return (React.createElement(CustomCell, __assign({}, props, { tdProps: tdProps, td2Props: td2Props }), content));\n }\n return render ?\n render.call(undefined, defaultRendering, props) :\n defaultRendering;\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { classNames } from '@progress/kendo-react-common';\nimport { GRID_ROW_INDEX_ATTRIBUTE } from '../constants';\n/**\n * The component for each of the items in the `data` property which the Grid renders.\n */\nvar GridRow = /** @class */ (function (_super) {\n __extends(GridRow, _super);\n function GridRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n GridRow.prototype.render = function () {\n var _a;\n var className = classNames('k-table-row', {\n 'k-grouping-row': this.props.rowType === 'groupHeader',\n 'k-group-footer': this.props.rowType === 'groupFooter',\n 'k-master-row': this.props.rowType !== 'groupHeader' &&\n this.props.rowType !== 'groupFooter',\n 'k-table-alt-row k-alt': this.props.rowType !== 'groupHeader' &&\n this.props.rowType !== 'groupFooter' &&\n this.props.isAltRow,\n 'k-selected': this.props.isSelected,\n 'k-grid-edit-row': this.props.isInEdit\n });\n var defaultRendering = (React.createElement(\"tr\", __assign({ id: this.props.id, onClick: this.props.onClick, onDoubleClick: this.props.onDoubleClick, className: className, style: {\n height: this.props.rowHeight ? this.props.rowHeight + 'px' : '',\n visibility: this.props.isHidden ? 'hidden' : ''\n }, role: \"row\", \"aria-rowindex\": this.props.ariaRowIndex, \"absolute-row-index\": this.props.absoluteRowIndex }, (_a = {}, _a[GRID_ROW_INDEX_ATTRIBUTE] = this.props.rowType === 'data' ? this.props.dataIndex : undefined, _a)), this.props.children));\n return this.props.render ?\n this.props.render.call(undefined, defaultRendering, this.props) :\n defaultRendering;\n };\n return GridRow;\n}(React.Component));\nexport { GridRow };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { guid } from '@progress/kendo-react-common';\nimport { GridColumnMenuWrapper } from '../columnMenu/GridColumnMenuWrapper';\n/**\n * @hidden\n */\nvar GridHeaderSelectionCell = /** @class */ (function (_super) {\n __extends(GridHeaderSelectionCell, _super);\n function GridHeaderSelectionCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._inputId = guid();\n return _this;\n }\n GridHeaderSelectionCell.prototype.render = function () {\n var _this = this;\n var columnMenuWrapperProps = this.props.columnMenuWrapperProps;\n var defaultRendering = [\n (React.createElement(\"input\", { key: 0, checked: this.props.selectionValue, id: this._inputId, type: \"checkbox\", className: \"k-checkbox k-checkbox-md k-rounded-md\", onChange: function (e) {\n return _this.props.selectionChange({\n field: _this.props.field,\n syntheticEvent: e\n });\n } })),\n (React.createElement(\"label\", { key: 1, className: \"k-checkbox-label\", htmlFor: this._inputId })),\n columnMenuWrapperProps.columnMenu && React.createElement(GridColumnMenuWrapper, __assign({}, columnMenuWrapperProps))\n ];\n return this.props.render ?\n this.props.render.call(undefined, defaultRendering, this.props) :\n defaultRendering;\n };\n return GridHeaderSelectionCell;\n}(React.Component));\nexport { GridHeaderSelectionCell };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as React from 'react';\nimport { registerForLocalization, provideLocalizationService as intl } from '@progress/kendo-react-intl';\nimport { messages, noRecords } from './messages';\n/* eslint-disable max-len */\n/**\n * Represents the GridNoRecords component. The component is rendered when the `data` property of the Grid is empty or `null`.\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * render() {\n * return (\n * \n * \n * There is no data available\n * \n * \n * \n * \n * );\n * }\n * }\n * ReactDOM.render(\n * ,\n * document.querySelector('my-app')\n * );\n * ```\n */\n// tslint:enable:max-line-length\nvar GridNoRecords = /** @class */ (function (_super) {\n __extends(GridNoRecords, _super);\n function GridNoRecords() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n GridNoRecords.prototype.render = function () {\n return this.props.children || intl(this).toLanguageString(noRecords, messages[noRecords]);\n };\n /**\n * @hidden\n */\n GridNoRecords.displayName = 'KendoReactGridNoRecords';\n return GridNoRecords;\n}(React.Component));\nexport { GridNoRecords };\nregisterForLocalization(GridNoRecords);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { footerColumns, resolveCells } from './../utils';\nimport { classNames } from '@progress/kendo-react-common';\n/**\n * @hidden\n */\nvar FooterRow = /** @class */ (function (_super) {\n __extends(FooterRow, _super);\n function FooterRow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._element = null;\n _this.renderCell = function (column, index) {\n var _a;\n var tdProps = (_a = {\n colSpan: column.colSpan !== 1 ? column.colSpan : undefined,\n style: column.left !== undefined\n ? !_this.props.isRtl\n ? { left: column.left, right: column.right }\n : { left: column.right, right: column.left }\n : {},\n className: classNames('k-table-td', column.locked && column.left !== undefined ? 'k-grid-footer-sticky' : ''),\n key: index,\n role: 'gridcell'\n },\n _a['aria-colindex'] = column.ariaColumnIndex,\n _a);\n var cellProps = __assign({ field: column.field, ariaColumnIndex: column.ariaColumnIndex }, tdProps);\n var customCells = resolveCells(_this.props.cells, column.cells);\n if (customCells && customCells.footerCell) {\n var CustomCell = customCells.footerCell;\n return React.createElement(CustomCell, __assign({}, cellProps, { tdProps: tdProps, index: index }));\n }\n return (column.footerCell && React.createElement(column.footerCell, __assign({}, cellProps, { key: index }))) || (React.createElement(\"td\", __assign({}, tdProps)));\n };\n return _this;\n }\n Object.defineProperty(FooterRow.prototype, \"element\", {\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n FooterRow.prototype.render = function () {\n return React.createElement(\"tr\", { className: 'k-table-row', role: \"row\", \"aria-rowindex\": this.props.ariaRowIndex }, footerColumns(this.props.columns).map(this.renderCell));\n };\n return FooterRow;\n}(React.Component));\nexport { FooterRow };\n","/**\n * @hidden\n */\nvar normalizeSettings = function (_a) {\n var _b = _a.buttonCount, buttonCount = _b === void 0 ? 10 : _b, _c = _a.info, info = _c === void 0 ? true : _c, _d = _a.type, type = _d === void 0 ? 'numeric' : _d, _e = _a.pageSizes, pageSizes = _e === void 0 ? undefined : _e, _f = _a.previousNext, previousNext = _f === void 0 ? true : _f, _g = _a.responsive, responsive = _g === void 0 ? undefined : _g, _h = _a.pageSizeValue, pageSizeValue = _h === void 0 ? undefined : _h;\n return ({\n buttonCount: buttonCount,\n info: info,\n pageSizes: pageSizes === true ? [5, 10, 20] : (pageSizes || undefined),\n previousNext: previousNext,\n responsive: responsive === false ? false : true,\n type: type,\n pageSizeValue: pageSizeValue\n });\n};\n/**\n * @hidden\n */\nexport var normalize = function (settings) {\n return normalizeSettings(settings === true ? {} : settings);\n};\n","/**\n * @hidden\n */\nexport var packageMetadata = {\n name: '@progress/kendo-react-grid',\n productName: 'KendoReact',\n productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],\n publishDate: 1695802233,\n version: '',\n licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport * as React from 'react';\n/** @hidden */\nexport var GridDetailCell = function (props) {\n var colSpan = props.colSpan, ariaColIndex = props.ariaColIndex, dataItem = props.dataItem, dataIndex = props.dataIndex, id = props.id;\n var navigationAttributes = useTableKeyboardNavigation(id);\n var onContextMenu = React.useCallback(function (event) {\n if (props.onContextMenu) {\n props.onContextMenu.call(undefined, event, props.dataItem);\n }\n }, [props.onContextMenu, props.dataItem]);\n return (React.createElement(\"td\", __assign({ onContextMenu: onContextMenu, className: \"k-table-td k-detail-cell\", colSpan: colSpan, \"aria-colindex\": ariaColIndex, role: 'gridcell' }, navigationAttributes),\n React.createElement(props.detail, { dataItem: dataItem, dataIndex: dataIndex })));\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';\nimport * as React from 'react';\n/** @hidden */\nexport var GridDetailHierarchyCell = function (props) {\n var navigationAttributes = useTableKeyboardNavigation(props.id);\n return (React.createElement(\"td\", __assign({ className: \"k-table-td k-hierarchy-cell\" }, navigationAttributes, { role: 'gridcell' })));\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { dispatchEvent, classNames, getter, guid, setScrollbarWidth, canUseDOM, memoizeOne, kendoThemeMaps } from '@progress/kendo-react-common';\nimport { tableColumnsVirtualization, Pager, mapColumns, updateLeft, updateRight, isRtl, tableKeyboardNavigation, TableKeyboardNavigationContext, tableKeyboardNavigationScopeAttributes, tableKeyboardNavigationTools as navigationTools, tableKeyboardNavigationBodyAttributes, getSelectionOptions, TableSelection, DropClue, DragClue } from '@progress/kendo-react-data-tools';\nimport { GridSelectionCell } from './cells/GridSelectionCell';\nimport { GridHierarchyCell } from './cells/GridHierarchyCell';\nimport { GridEditCell } from './cells/GridEditCell';\nimport { Header } from './header/Header';\nimport { HeaderRow } from './header/HeaderRow';\nimport { FilterRow } from './header/FilterRow';\nimport { GroupPanel } from './header/GroupPanel';\nimport { Footer } from './footer/Footer';\nimport { VirtualScroll } from './VirtualScroll';\nimport { RowHeightService, VirtualScrollFixed } from './VirtualScrollFixed';\nimport { ColumnResize } from './drag/ColumnResize';\nimport { CommonDragLogic } from './drag/CommonDragLogic';\nimport { getNestedValue, flatData, readColumns, autoGenerateColumns, firefox, firefoxMaxHeight, sanitizeColumns, resolveCells, getColumnWidth } from './utils/index';\nimport { GridCell } from './cells/GridCell';\nimport { GridGroupCell } from './cells/GridGroupCell';\nimport { GridRow } from './rows/GridRow';\nimport { GridHeaderSelectionCell } from './header/GridHeaderSelectionCell';\nimport { GridNoRecords } from './GridNoRecords';\nimport { operators } from './filterCommon';\nimport { FooterRow } from './footer/FooterRow';\nimport { normalize } from './paging/GridPagerSettings';\nimport { pagerMessagesMap } from './messages';\nimport { validatePackage, shouldShowValidationUI, WatermarkOverlay } from '@progress/kendo-react-common';\nimport { packageMetadata } from './package-metadata';\nimport { GridDetailCell } from './cells/GridDetailCell';\nimport { GridDetailHierarchyCell } from './cells/GridDetailHierarchyCell';\n/**\n * Represents the [KendoReact Grid component]({% slug overview_grid %}).\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * constructor(props) {\n * super(props);\n * this.state = {\n * data: [\n * { 'foo': 'A1', 'bar': 'B1' },\n * { 'foo': 'A2', 'bar': 'B2' },\n * { 'foo': 'A3', 'bar': 'B2' }\n * ]\n * };\n * }\n * render() {\n * return (\n * \n * \n * \n * \n * );\n * }\n * }\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\nvar Grid = /** @class */ (function (_super) {\n __extends(Grid, _super);\n function Grid(props) {\n var _this = _super.call(this, props) || this;\n _this._columns = [];\n _this._columnsMap = [[]];\n _this._columnsMutations = 0;\n _this._resized = false;\n _this._shouldUpdateLeftRight = true;\n _this.contextStateRef = { current: undefined };\n _this.navigationStateRef = { current: undefined };\n _this._data = [];\n _this._slicedData = undefined;\n _this.wrapperScrollTop = 0;\n _this.showLicenseWatermark = false;\n _this.headerRef = React.createRef();\n _this.headerElementRef = React.createRef();\n _this._element = null;\n _this.tableElement = null;\n _this.containerRef = React.createRef();\n _this.tableBodyRef = React.createRef();\n _this._footer = null;\n _this.forceUpdateTimeout = undefined;\n _this.isRtl = false;\n _this._gridId = guid();\n _this._gridRoleElementId = guid(); // Needed for aria-control accessibility attribute\n _this.observer = null;\n _this.handleIntersection = function (entries) {\n var options = { rowIndex: _this.rowIndex };\n entries.forEach(function (entry) {\n if (!entry.isIntersecting) {\n _this.setCurrentOnTop(options);\n }\n });\n };\n _this.setCurrentOnTop = function (options) {\n if (!_this.vs.container || _this.props.scrollable === 'none') {\n return;\n }\n if (_this.observer) {\n _this.observer.disconnect();\n }\n var rowIndex = options.rowIndex;\n if (_this.props.scrollable === 'virtual') {\n _this.vs.askedSkip = rowIndex;\n _this.vs.container.scroll(0, Math.round(_this.vs.askedSkip / _this.vs.total * _this.vs.container.scrollHeight));\n }\n else if (_this.element) {\n var selectedRow = rowIndex < 1\n ? _this.element.querySelector(\"tbody > tr:nth-child(\".concat(1, \")\"))\n : _this.element.querySelector(\"tbody > tr:nth-child(\".concat(rowIndex + 1, \")\"));\n if (selectedRow && _this.containerRef.current) {\n _this.containerRef.current.scrollTop = selectedRow.offsetTop;\n }\n }\n };\n /**\n * Method to allow the scroll to be set to a specific row index when the Grid is scrollable. It is zero based.\n *\n * @param options - Object, containing the rowIndex to which is going to be scrolled.\n */\n _this.scrollIntoView = function (options) {\n if (!_this.vs.container || _this.props.scrollable === 'none') {\n return;\n }\n _this.rowIndex = options.rowIndex;\n var rowIndex = options.rowIndex;\n var element = _this.element;\n if (_this.observer && element) {\n _this.observer.disconnect();\n var target = element.querySelector(\"[absolute-row-index=\\\"\".concat(rowIndex, \"\\\"]\"));\n if (target) {\n _this.observer.observe(target);\n }\n else {\n _this.setCurrentOnTop(options);\n }\n }\n };\n /**\n * Method to fit columns according to their content.\n *\n * @param columnIds - Array of column ids to be fitted.\n */\n _this.fitColumns = function (columnIds) {\n _this.columnResize.dblClickHandler(null, columnIds);\n };\n _this.onContextMenu = function (event, dataItem, field) {\n if (_this.props.onContextMenu) {\n var ev = {\n target: _this,\n syntheticEvent: event,\n nativeEvent: event.nativeEvent,\n dataItem: dataItem,\n field: field\n };\n _this.props.onContextMenu.call(undefined, ev);\n }\n };\n _this.getVirtualScroll = function (props) {\n var rowHeight = props.rowHeight, detailRowHeight = props.detailRowHeight, detail = props.detail, expandField = props.expandField, groupable = props.groupable;\n var hasAllData = _this.isAllData();\n var hasRowHeight = rowHeight !== undefined && rowHeight > 0;\n var hasDetailRowHeight = detailRowHeight !== undefined && detailRowHeight > 0;\n var isGroupable = groupable === true || (typeof groupable === 'object' && groupable.enabled !== false);\n var hasDetails = Boolean(detail && expandField);\n if (!hasRowHeight ||\n (isGroupable && !hasAllData) ||\n (hasDetails && (!hasDetailRowHeight || !hasAllData))) {\n return VirtualScroll;\n }\n return VirtualScrollFixed;\n };\n _this.isAllData = function () {\n var _a = _this.props, data = _a.data, total = _a.total;\n if (Array.isArray(data)) {\n return data.length === total;\n }\n else if (data) {\n return total === data.total;\n }\n return false;\n };\n _this.initializeVirtualization = function (total, groupable) {\n _this.reInitVirtualization(_this.props.scrollable === 'virtual', _this.props.total, _this.props.filter, _this.props.group, _this.props.sort, groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);\n _this.vs.fixedScroll = _this.props.fixedScroll || false;\n _this.vs.PageChange = _this.pageChange;\n _this.vs.realSkip = _this.props.skip || 0;\n _this.vs.pageSize = (_this.props.take !== undefined ? _this.props.take : _this.props.pageSize) || 0;\n _this.vs.scrollableVirtual = (_this.props.scrollable === 'virtual');\n _this.vs.total = total;\n _this.vs.propsSkip = (_this.props.skip || 0) + (_this.props.scrollable === 'virtual' ?\n _this.vs.topCacheCount + (_this.vs.attendedSkip - (_this.props.skip || 0)) : 0);\n if (_this.props.rowHeight !== undefined && _this.props.rowHeight > 0 && !groupable) {\n var containerHeight = _this.props.rowHeight * total;\n _this.vs.containerHeight = firefox ? Math.min(firefoxMaxHeight, containerHeight) : containerHeight;\n }\n else {\n _this.vs.containerHeight = 1533915;\n }\n _this.vs.containerRef = _this.containerRef;\n _this.vs.tableBodyRef = _this.tableBodyRef;\n _this.vs.table = _this.tableElement;\n _this._slicedData = undefined;\n if (_this.vs instanceof VirtualScrollFixed) {\n var _a = _this.props, _b = _a.rowHeight, rowHeight = _b === void 0 ? 0 : _b, detail = _a.detail, expandField = _a.expandField;\n var _c = _this.props.detailRowHeight, detailRowHeight = _c === void 0 ? 0 : _c;\n detailRowHeight = Boolean(detail && expandField) ? detailRowHeight : rowHeight;\n if (_this.isAllData()) {\n _this.vs.total = _this._data.length;\n _this._slicedData = _this._data.slice(_this.vs.realSkip, _this.vs.realSkip + _this.vs.pageSize);\n _this.vs.rowHeightService = _this.rowHeightService(_this.vs, _this._data.length, rowHeight, detailRowHeight, _this._data);\n }\n else {\n _this.vs.rowHeightService = new RowHeightService(total, rowHeight, detailRowHeight);\n }\n var containerHeight = _this.vs.rowHeightService.totalHeight();\n _this.vs.containerHeight = firefox ? Math.min(firefoxMaxHeight, containerHeight) : containerHeight;\n }\n };\n _this.scrollHandler = function (event) {\n if (event.target !== event.currentTarget) {\n return;\n }\n clearTimeout(_this.forceUpdateTimeout);\n _this.vs.table = _this.tableElement;\n var scrollLeft = event.currentTarget.scrollLeft;\n var scrollTop = event.currentTarget.scrollTop;\n if (_this.props.columnVirtualization && (!_this.vs.scrollableVirtual || scrollTop === _this.wrapperScrollTop)) {\n _this.forceUpdateTimeout = window.setTimeout(function () { _this.forceUpdate(); }, 0);\n }\n if (_this._header) {\n _this._header.setScrollLeft(scrollLeft);\n }\n if (_this._footer) {\n _this._footer.setScrollLeft(scrollLeft);\n }\n if (_this.vs && scrollTop !== _this.wrapperScrollTop) {\n _this.vs.scrollHandler(event);\n }\n dispatchEvent(_this.props.onScroll, event, _this, undefined);\n _this.wrapperScrollTop = scrollTop;\n };\n _this.onKeyDown = function (event) {\n tableKeyboardNavigation.onKeyDown(event, {\n contextStateRef: _this.contextStateRef,\n navigationStateRef: _this.navigationStateRef,\n onNavigationAction: _this.onNavigationAction\n });\n if (_this.props.onKeyDown) {\n var _a = getSelectionOptions(_this.props.selectable), mode = _a.mode, cell = _a.cell;\n var ev = __assign({ dataItems: _this.getLeafDataItems(), mode: mode, cell: cell, componentId: _this._gridId, selectedField: _this.props.selectedField }, _this.getArguments(event));\n _this.props.onKeyDown.call(undefined, ev);\n }\n };\n _this.onFocus = function (event) {\n tableKeyboardNavigation.onFocus(event, {\n contextStateRef: _this.contextStateRef\n });\n };\n _this.onNavigationAction = function (options) {\n if (_this.props.onNavigationAction) {\n var ev = __assign({ focusElement: options.focusElement }, _this.getArguments(options.event));\n _this.props.onNavigationAction.call(undefined, ev);\n }\n };\n _this.rowClick = function (e, item) {\n if (_this.props.onRowClick && e.target.nodeName === 'TD') {\n _this.props.onRowClick.call(undefined, __assign({ dataItem: item.dataItem }, _this.getArguments(e)));\n }\n };\n _this.rowDblClick = function (e, item) {\n if (_this.props.onRowDoubleClick && e.target.nodeName === 'TD') {\n _this.props.onRowDoubleClick.call(undefined, __assign({ dataItem: item.dataItem }, _this.getArguments(e)));\n }\n };\n _this.itemChange = function (event) {\n var itemChange = _this.props.onItemChange;\n if (event.field === _this.props.expandField || _this.props.group && event.field === undefined) {\n var expandChange = _this.props.onExpandChange;\n if (expandChange) {\n expandChange.call(undefined, __assign(__assign({}, _this.getArguments(event.syntheticEvent)), { dataItem: event.dataItem, dataIndex: event.dataIndex, value: event.value }));\n }\n return;\n }\n if (itemChange) {\n itemChange.call(undefined, __assign(__assign({}, _this.getArguments(event.syntheticEvent)), { dataItem: event.dataItem, field: event.field, value: event.value }));\n }\n };\n _this.onHeaderSelectionChange = function (event) {\n if (_this.props.onHeaderSelectionChange) {\n _this.props.onHeaderSelectionChange.call(undefined, {\n field: event.field,\n nativeEvent: event.syntheticEvent && event.syntheticEvent.nativeEvent,\n syntheticEvent: event.syntheticEvent,\n target: _this,\n dataItems: _this.getLeafDataItems(),\n selectedField: _this.props.selectedField\n });\n }\n };\n _this.selectionRelease = function (event) {\n if (_this.props.onSelectionChange) {\n var selectionEvent = __assign({ syntheticEvent: undefined, target: _this, selectedField: _this.props.selectedField || '', componentId: _this._gridId, dataItems: _this.getLeafDataItems(), dataItem: null }, event);\n _this.props.onSelectionChange.call(undefined, selectionEvent);\n }\n };\n _this.pageChange = function (page, syntheticEvent, targetEvent) {\n _this.raiseDataEvent(_this.props.onPageChange, { page: page }, { skip: page.skip, take: page.take }, syntheticEvent, targetEvent);\n };\n _this.pagerPageChange = function (event) {\n _this.pageChange({ skip: event.skip, take: event.take }, event.syntheticEvent, event.targetEvent);\n };\n _this.sortChange = function (sort, syntheticEvent) {\n _this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, __assign({ sort: sort }, (_this.props.scrollable === 'virtual' ? { skip: 0 } : {})), syntheticEvent);\n };\n _this.filterChange = function (filter, syntheticEvent) {\n _this.raiseDataEvent(_this.props.onFilterChange, { filter: filter }, { filter: filter || undefined, skip: 0 }, syntheticEvent);\n };\n _this.groupChange = function (groups, event) {\n var syntheticEvent = event.nativeEvent ?\n event : { nativeEvent: event.nativeEvent || event.originalEvent };\n _this.raiseDataEvent(_this.props.onGroupChange, { group: groups }, { group: groups, skip: 0 }, syntheticEvent);\n };\n _this.onResize = function (index, newWidth, oldWidth, nativeEvent, end, targetId) {\n _this.resetTableWidth();\n _this._shouldUpdateLeftRight = true;\n _this._resized = true;\n _this._columnsMutations++;\n if (_this.props.onColumnResize) {\n _this.props.onColumnResize.call(undefined, {\n columns: _this.columns,\n nativeEvent: nativeEvent,\n targetColumnId: targetId,\n index: index,\n newWidth: newWidth,\n oldWidth: oldWidth,\n end: end,\n target: _this\n });\n }\n };\n _this.reInitVirtualization = memoizeOne(function (_vScrolling, _total, _filter, _group, _sort, useCached) {\n _this.vs.reset();\n var VS = _this.getVirtualScroll(_this.props);\n _this.vs = new VS(useCached);\n });\n _this.flatData = memoizeOne(function (propsData, groupingFooter, skip, group, expandField, _filter, _sort) {\n var flattedData = [];\n var resolvedGroupsCount = flatData(flattedData, propsData, groupingFooter, { index: skip }, group !== undefined, expandField);\n return { flattedData: flattedData, resolvedGroupsCount: resolvedGroupsCount };\n });\n _this.rowHeightService = memoizeOne(function (_vs, total, rowHeight, detailRowHeight, data) {\n return new RowHeightService(total, rowHeight, detailRowHeight, data);\n });\n _this.childrenToArray = memoizeOne(function (children) {\n return React.Children.toArray(children);\n });\n _this.readColumns = memoizeOne(function (children, idPrefix, _mutationsCount) {\n var columnElements = children.filter(function (child) { return child && child.type && child.type.displayName === 'KendoReactGridColumn'; });\n return readColumns(columnElements, _this.columns, { prevId: 0, idPrefix: idPrefix });\n });\n _this.mapColumns = memoizeOne(function (columns) {\n return mapColumns(columns);\n });\n _this.configureColumns = memoizeOne(function (columns, groupCount, idPrefix) {\n if (_this.props.selectedField) {\n columns.filter(function (c) { return c.field === _this.props.selectedField; }).forEach(function (c) {\n c.width = c.width || '50px';\n c.cell = c.cell || GridSelectionCell;\n c.headerCell = c.headerCell || GridHeaderSelectionCell;\n });\n }\n var defaultServiceProps = {\n id: '',\n resizable: true,\n width: '32px',\n title: ' ',\n declarationIndex: -1,\n orderIndex: -1,\n children: [],\n parentIndex: -1,\n depth: 0,\n colSpan: 0,\n rowSpan: 0,\n left: 0,\n right: 0,\n index: 0,\n rightBorder: false,\n ariaColumnIndex: 0,\n isAccessible: true\n };\n var columnIndexOffset = 0;\n if (_this.props.expandField && (_this.props.onExpandChange) && _this.props.detail) {\n columns.unshift(__assign(__assign({}, defaultServiceProps), { cell: GridHierarchyCell, field: _this.props.expandField, headerClassName: 'k-hierarchy-cell k-header', id: navigationTools.generateNavigatableId(\"\".concat(_this._columns.length), idPrefix, 'column') }));\n columnIndexOffset++;\n }\n for (var i = 0; i < groupCount; i++) {\n columns.unshift(__assign(__assign({}, defaultServiceProps), { isAccessible: false, cell: GridGroupCell, field: 'value', locked: _this.props.lockGroups }));\n columnIndexOffset++;\n }\n columns.slice(columnIndexOffset).forEach(function (c) { return c.parentIndex >= 0 && (c.parentIndex += columnIndexOffset); });\n });\n _this.getHeaderRow = memoizeOne(function (sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, columns, columnsMap, isHeaderRtl) {\n return (React.createElement(HeaderRow, { cells: _this.props.cells, sort: sort, sortable: sortable, sortChange: _this.sortChange, group: group || [], groupable: groupable, groupChange: _this.groupChange, filter: filter, filterable: filterable, filterOperators: filterOperators, filterChange: _this.filterChange, columnMenu: columnMenu, selectionChange: _this.onHeaderSelectionChange, columns: columns, columnResize: _this.columnResize, pressHandler: _this.dragLogic.pressHandler, dragHandler: _this.dragLogic.dragHandler, releaseHandler: _this.dragLogic.releaseHandler, columnsMap: columnsMap, cellRender: headerCellRender, isRtl: isHeaderRtl, dragClue: _this.dragLogic.dragClueRef, headerRef: _this.headerElementRef, containerRef: _this.containerRef }));\n });\n _this.resolveTitle = function (field) {\n var column = _this._columns.find(function (c) { return c.field === field; });\n var title = column && (column.title || column.field);\n return title === undefined ? field : title;\n };\n _this.getLeafDataItems = function () {\n return _this._data.filter(function (item) { return item.rowType === 'data'; }).map(function (item) { return item.dataItem; });\n };\n validatePackage(packageMetadata);\n _this.showLicenseWatermark = shouldShowValidationUI(packageMetadata);\n var groupable = _this.props.groupable === true ||\n (typeof _this.props.groupable === 'object') && _this.props.groupable.enabled !== false;\n var VS = _this.getVirtualScroll(props);\n _this.vs = new VS(groupable || props.rowHeight === undefined || props.rowHeight === 0);\n _this.dragLogic = new CommonDragLogic(_this.columnReorder.bind(_this), _this.groupReorder.bind(_this), _this.columnToGroup.bind(_this));\n _this.columnResize = new ColumnResize(_this.onResize);\n tableKeyboardNavigation.onConstructor({\n navigatable: Boolean(props.navigatable),\n contextStateRef: _this.contextStateRef,\n navigationStateRef: _this.navigationStateRef,\n idPrefix: _this._gridId\n });\n return _this;\n }\n Object.defineProperty(Grid.prototype, \"columns\", {\n /* eslint-disable max-len */\n /**\n * A getter of the current columns. Gets the current column width or current columns, or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column. Can be used on each Grid instance. To obtain the instance of the rendered Grid, use the `ref` callback. The following example demonstrates how to reorder the columns by dragging their handlers and check the properties afterwards. You can check the result in the browser console.\n *\n * @example\n * ```jsx\n * class App extends React.Component {\n * constructor(props) {\n * super(props);\n * this.state = {\n * data: [\n * { 'foo': 'A1', 'bar': 'B1' },\n * { 'foo': 'A2', 'bar': 'B2' },\n * { 'foo': 'A3', 'bar': 'B2' }\n * ]\n * };\n * this.grid = null;\n * }\n * render() {\n * return (\n *
    \n * { this.grid = g; }}\n * >\n * \n * \n * \n * \n *
    \n * );\n * }\n * }\n * ReactDOM.render(, document.querySelector('my-app'));\n * ```\n */\n // tslint:enable:max-line-length\n get: function () {\n var shuffledColumns = this._columns.filter(function (q) { return q.declarationIndex >= 0 && q.parentIndex === -1; });\n return sanitizeColumns(shuffledColumns);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Grid.prototype, \"element\", {\n /**\n * Returns the HTML element of the Grid component.\n */\n get: function () {\n return this._element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Grid.prototype, \"document\", {\n get: function () {\n if (!canUseDOM) {\n return;\n }\n // useful only for user actions\n return (this.element && this.element.ownerDocument) || document;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Grid.prototype, \"_header\", {\n get: function () {\n return this.headerRef.current;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @hidden\n */\n Grid.prototype.componentDidMount = function () {\n this.resetTableWidth();\n setScrollbarWidth();\n var rtl = isRtl(this.element);\n this.isRtl = rtl;\n tableKeyboardNavigation.onComponentDidMount({\n scope: this.element || undefined,\n contextStateRef: this.contextStateRef,\n navigationStateRef: this.navigationStateRef\n });\n if (this.isRtl) {\n this.forceUpdate();\n }\n var observerOptions = {\n rootMargin: '0px',\n threshold: 0.9\n };\n this.observer = (canUseDOM && window.IntersectionObserver &&\n new window.IntersectionObserver(this.handleIntersection, observerOptions) || null);\n };\n /**\n * @hidden\n */\n Grid.prototype.getSnapshotBeforeUpdate = function () {\n tableKeyboardNavigation.onGetSnapshotBeforeUpdate({\n document: this.document,\n contextStateRef: this.contextStateRef,\n navigationStateRef: this.navigationStateRef\n });\n return null;\n };\n /**\n * @hidden\n */\n Grid.prototype.componentDidUpdate = function () {\n this.resetTableWidth();\n setScrollbarWidth();\n if (this.vs.tableTransform && this.vs.table) {\n this.vs.table.style.transform = this.vs.tableTransform;\n this.vs.tableTransform = '';\n }\n tableKeyboardNavigation.onComponentDidUpdate({\n scope: this.element || undefined,\n contextStateRef: this.contextStateRef,\n navigationStateRef: this.navigationStateRef\n });\n };\n /**\n * @hidden\n */\n Grid.prototype.componentWillUnmount = function () {\n clearTimeout(this.forceUpdateTimeout);\n };\n /**\n * @hidden\n */\n Grid.prototype.render = function () {\n var _a, _b, _c, _d;\n var _this = this;\n var _e;\n var total = this.props.total || 0;\n var idPrefix = navigationTools.getIdPrefix(this.navigationStateRef);\n var propsData = [];\n if (Array.isArray(this.props.data)) {\n propsData = this.props.data;\n total = total || this.props.data.length;\n }\n else if (this.props.data) {\n propsData = this.props.data.data;\n total = total || this.props.data.total;\n }\n var groupingFooter = (typeof this.props.groupable === 'object') && this.props.groupable.footer || 'none';\n var _f = this.flatData(propsData, groupingFooter, this.props.skip || 0, this.props.group, this.props.expandField, this.props.filter, this.props.sort), resolvedGroupsCount = _f.resolvedGroupsCount, flattedData = _f.flattedData;\n this._data = flattedData;\n var groupable = this.props.groupable === true ||\n (typeof this.props.groupable === 'object') && this.props.groupable.enabled !== false;\n this.columnResize.resizable = this.props.resizable || false;\n this.dragLogic.reorderable = this.props.reorderable || false;\n this.dragLogic.groupable = groupable;\n var tableUserSelect = this.props.selectable && this.props.selectable.drag ? 'none' : undefined;\n this.initializeVirtualization(total, groupable);\n var children = this.childrenToArray(this.props.children);\n this.initColumns(children, resolvedGroupsCount);\n var toolbar = children.map(function (child) {\n if (child && child.type && child.type.displayName === 'KendoReactGridToolbar') {\n return React.cloneElement(child, __assign(__assign({}, child.props), { ariaControls: _this._gridRoleElementId }));\n }\n return null;\n });\n var noRecords = children.filter(function (child) { return child && child.type &&\n child.type.displayName === 'KendoReactGridNoRecords'; });\n var statusBar = children.filter(function (child) { return child && child.type &&\n child.type.displayName === 'KendoReactGridStatusBar'; });\n var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });\n var groupingPanel = groupable && (React.createElement(GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId }));\n var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;\n var header = (React.createElement(Header, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, elemRef: this.headerElementRef, headerRow: this.getHeaderRow(sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, this._columns, this._columnsMap, this.isRtl), filterRow: this.props.filterable && React.createElement(FilterRow, { cells: this.props.cells, size: this.props.size, columns: this._columns, filter: this.props.filter, filterOperators: this.props.filterOperators || operators, filterChange: this.filterChange, sort: this.props.sort, cellRender: this.props.filterCellRender, isRtl: this.isRtl, ariaRowIndex: this._columnsMap.length + 1 }) || undefined, cols: leafColumns.map(function (column, index) { return (React.createElement(\"col\", { key: index.toString(), width: getColumnWidth(column) })); }) }));\n var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;\n var tableWidth = parseFloat(((this.props.style || {}).width || '').toString());\n var _j = tableColumnsVirtualization({\n enabled: this.props.columnVirtualization,\n columns: leafColumns,\n tableViewPortWidth: tableWidth,\n scrollLeft: scrollLeft\n }), colSpans = _j.colSpans, isColHidden = _j.hiddenColumns;\n var dataRow = function (item, rowId, rowDataIndex) {\n var isInEdit = false;\n var selectedValue = _this.props.selectedField ? getNestedValue(_this.props.selectedField, item.dataItem) : undefined;\n return {\n row: leafColumns.map(function (column, columnIndex) {\n if (isColHidden[columnIndex]) {\n return null;\n }\n var columnKey = column.id ? column.id : columnIndex;\n var className = \"\".concat(column.className ? column.className + ' ' : '')\n + \"\".concat(column.locked ? 'k-grid-content-sticky' : '');\n var style = column.left !== undefined\n ? !_this.isRtl\n ? { left: column.left, right: column.right }\n : { left: column.right, right: column.left }\n : {};\n var currentColumnIsInEdit = false;\n if (column.editable && _this.props.editField) {\n var inEdit = getNestedValue(_this.props.editField, item.dataItem);\n if (inEdit === true || inEdit === column.field) {\n isInEdit = true;\n currentColumnIsInEdit = true;\n }\n }\n var Cell = column.cell || (currentColumnIsInEdit && GridEditCell) || GridCell;\n return (React.createElement(Cell, { onContextMenu: _this.onContextMenu, key: columnKey, locked: _this.props.lockGroups, id: navigationTools.generateNavigatableId(\"\".concat(rowId, \"-\").concat(String(columnIndex)), idPrefix), colSpan: colSpans[columnIndex], dataItem: item.dataItem, field: column.field, editor: column.editor, format: column.format, className: className, render: _this.props.cellRender, cells: resolveCells(_this.props.cells, column.cells), onChange: _this.itemChange, selectionChange: (_this.props.onSelectionChange) ?\n (function (e) { _this.selectionChange({ event: e, dataItem: item.dataItem, dataIndex: rowDataIndex, columnIndex: columnIndex }); }) :\n undefined, columnIndex: columnIndex, columnsCount: leafColumns.length, rowType: item.rowType, level: item.level, expanded: item.expanded, dataIndex: item.dataIndex, style: style, ariaColumnIndex: column.ariaColumnIndex, isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(columnIndex) > -1 }));\n }),\n isInEdit: isInEdit,\n isSelected: typeof selectedValue === 'boolean' && selectedValue\n };\n };\n var hiddenRows = 0;\n if (this.props.scrollable === 'virtual') {\n for (var i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {\n var item = this._data.shift();\n if (item) {\n this._data.push(item);\n hiddenRows++;\n if (item.rowType === 'groupHeader') {\n i--;\n }\n }\n else {\n break;\n }\n }\n }\n var hidden = function (index) {\n return (index >= _this._data.length - hiddenRows);\n };\n var absoluteDataIndex = this.vs.realSkip || 0;\n var body = [];\n var rowIndexStart = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;\n var currentAriaRowIndex = 0;\n if (this._data.length) {\n var dataIndex_1 = -1;\n var detailRowCount_1 = 0;\n (this._slicedData || this._data).forEach(function (item, rowIndex) {\n if (item.rowType === 'data') {\n absoluteDataIndex++;\n dataIndex_1++;\n }\n var isAlt = absoluteDataIndex % 2 === 0;\n var dataItemKey = _this.props.dataItemKey && getter(_this.props.dataItemKey)(item.dataItem);\n var absoluteIndex = rowIndex + (_this.vs.realSkip || 0);\n var rowId = dataItemKey ? dataItemKey : 'ai' + absoluteIndex;\n var detailRowId = rowId + '_1';\n var gridRow = dataRow(item, rowId, dataIndex_1);\n currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount_1;\n body.push((React.createElement(GridRow, { key: rowId, dataItem: item.dataItem, isAltRow: isAlt, isInEdit: gridRow.isInEdit, rowType: item.rowType, isHidden: hidden(rowIndex), onClick: function (e) { return _this.rowClick(e, item); }, onDoubleClick: function (e) { return _this.rowDblClick(e, item); }, selectedField: _this.props.selectedField, rowHeight: _this.props.rowHeight, render: _this.props.rowRender, ariaRowIndex: currentAriaRowIndex, absoluteRowIndex: absoluteIndex, dataIndex: dataIndex_1, isSelected: gridRow.isSelected }, gridRow.row)));\n if (_this.props.detail && item.rowType === 'data' && item.expanded) {\n var detailColspan = (leafColumns.length\n - (_this.props.expandField ? 1 : 0)\n - (_this.props.group ? _this.props.group.length : 0)) || 1;\n detailRowCount_1++;\n currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount_1;\n body.push((React.createElement(\"tr\", { key: detailRowId, className: classNames('k-table-row', isAlt ? 'k-detail-row k-table-alt-row k-alt' : 'k-detail-row'), style: { visibility: hidden(rowIndex) ? 'hidden' : '', height: _this.props.detailRowHeight }, role: \"row\", \"aria-rowindex\": currentAriaRowIndex },\n _this.props.group && _this.props.group.map(function (gr, idx) {\n var _a;\n var columnStyle = (_a = gridRow === null || gridRow === void 0 ? void 0 : gridRow.row[idx]) === null || _a === void 0 ? void 0 : _a.props.style;\n var style = columnStyle\n ? !_this.isRtl\n ? { left: columnStyle.left, right: columnStyle.right }\n : { left: columnStyle.right, right: columnStyle.left }\n : {};\n return (React.createElement(GridGroupCell, { id: '', dataIndex: item.dataIndex, field: gr.field, dataItem: item.dataItem, key: idx, style: style, ariaColumnIndex: 1 + idx, isSelected: false, locked: _this.props.lockGroups, isRtl: _this.isRtl, cells: _this.props.cells }));\n }),\n _this.props.expandField &&\n React.createElement(GridDetailHierarchyCell, { id: navigationTools.generateNavigatableId(\"\".concat(detailRowId, \"-dhcell\"), idPrefix) }),\n React.createElement(GridDetailCell, { onContextMenu: _this.onContextMenu, dataItem: item.dataItem, dataIndex: item.dataIndex, colSpan: detailColspan, ariaColIndex: 2 + (_this.props.group ? _this.props.group.length : 0), detail: _this.props.detail, id: navigationTools.generateNavigatableId(\"\".concat(detailRowId, \"-dcell\"), idPrefix) }))));\n }\n });\n }\n else {\n body.push((React.createElement(\"tr\", { key: \"no-records\", className: \"k-table-row k-grid-norecords\", role: 'row', \"aria-rowindex\": rowIndexStart },\n React.createElement(\"td\", { className: 'k-table-td', colSpan: leafColumns.length, role: 'gridcell' }, noRecords.length ? noRecords : React.createElement(GridNoRecords, null)))));\n }\n var pagerProps = __assign({ size: this.props.size, onPageChange: this.pagerPageChange, total: total, dir: this.isRtl ? 'rtl' : undefined, skip: this.vs.propsSkip || 0, take: (this.props.take !== undefined ? this.props.take : this.props.pageSize) || 10, messagesMap: pagerMessagesMap }, (normalize(this.props.pageable || {})));\n var pager = this.props.pager ? React.createElement(this.props.pager, __assign({}, pagerProps)) : React.createElement(Pager, __assign({ className: \"k-grid-pager\" }, pagerProps));\n var sorted = function (field) {\n return _this.props.sort && _this.props.sort.filter(function (descriptor) { return descriptor.field === field; }).length > 0;\n };\n var footerCols = function (column, index) {\n return (React.createElement(\"col\", { key: index.toString(), width: getColumnWidth(column) }));\n };\n var footer = (Boolean((_e = this.props.cells) === null || _e === void 0 ? void 0 : _e.footerCell)\n || this._columns.some(function (c) { var _a; return Boolean(c.footerCell || Boolean((_a = c.cells) === null || _a === void 0 ? void 0 : _a.footerCell)); }))\n ? (React.createElement(Footer, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', ref: function (f) { return _this._footer = f; }, row: React.createElement(FooterRow, { cells: this.props.cells, columns: this._columns, isRtl: this.isRtl, ariaRowIndex: currentAriaRowIndex + 1 }), cols: leafColumns.map(footerCols) })) : null;\n var colGroups = (React.createElement(\"colgroup\", { ref: function (c) {\n _this.columnResize.colGroupMain = c;\n } }, leafColumns.map(function (column, index) { return (React.createElement(\"col\", { key: index.toString(), className: sorted(column.field) ? 'k-sorted' : undefined, width: getColumnWidth(column) })); })));\n var enableDragClues = this.dragLogic.reorderable || this.dragLogic.groupable;\n var tableDisplay = this.props.columnVirtualization ? 'block' : 'table';\n if (this.props.scrollable === 'none') {\n return (React.createElement(TableKeyboardNavigationContext.Provider, { value: this.contextStateRef.current },\n React.createElement(\"div\", __assign({ id: this.props.id, style: this.props.style, className: classNames('k-grid', (_a = {\n 'k-grid-md': !this.props.size\n },\n _a[\"k-grid-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _a), this.props.className), ref: function (el) { _this._element = el; }, \"aria-label\": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),\n toolbar,\n groupingPanel,\n React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) { _this.tableElement = table; } },\n React.createElement(\"table\", { className: classNames('k-table k-grid-table', (_b = {}, _b[\"k-table-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size, _b)), style: { userSelect: tableUserSelect, display: tableDisplay } },\n colGroups,\n header,\n React.createElement(\"tbody\", __assign({ role: 'rowgroup', className: 'k-table-tbody' }, tableKeyboardNavigationBodyAttributes), body),\n footer)),\n enableDragClues && (React.createElement(React.Fragment, null,\n React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),\n React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue })))),\n statusBar,\n this.props.pageable && pager));\n }\n var wrapperStyle = this.props.style || {};\n if (this.props.scrollable === 'virtual') {\n // Set the default height for vs if not existing.\n if (!wrapperStyle.height) {\n wrapperStyle = Object.assign({}, wrapperStyle, { height: '450px' });\n }\n }\n return (React.createElement(TableKeyboardNavigationContext.Provider, { value: this.contextStateRef.current },\n React.createElement(\"div\", __assign({ id: this.props.id, style: wrapperStyle, className: classNames('k-grid', (_c = {\n 'k-grid-md': !this.props.size\n },\n _c[\"k-grid-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _c['k-grid-virtual'] = this.props.scrollable === 'virtual',\n _c), this.props.className), ref: function (el) {\n _this._element = el;\n }, \"aria-label\": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),\n toolbar,\n groupingPanel,\n React.createElement(\"div\", { className: 'k-grid-aria-root', role: \"grid\", \"aria-colcount\": leafColumns.length, \"aria-rowcount\": total, id: this._gridRoleElementId },\n header,\n React.createElement(\"div\", { className: \"k-grid-container\", role: \"presentation\" },\n React.createElement(\"div\", { ref: this.containerRef, className: \"k-grid-content k-virtual-content\", onScroll: this.scrollHandler, role: \"presentation\" },\n React.createElement(\"div\", { className: 'k-grid-table-wrap', role: \"presentation\" },\n React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {\n _this.tableElement = table;\n } },\n React.createElement(\"table\", { className: classNames('k-table k-grid-table', (_d = {\n 'k-table-md': !this.props.size\n },\n _d[\"k-table-\".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,\n _d)), role: \"presentation\", style: { userSelect: tableUserSelect, display: tableDisplay } },\n colGroups,\n React.createElement(\"tbody\", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, tableKeyboardNavigationBodyAttributes), body)))),\n React.createElement(\"div\", { className: \"k-height-container\", role: \"presentation\" },\n React.createElement(\"div\", { style: this.props.scrollable === 'virtual' ?\n { 'height': (this.vs.containerHeight) + 'px' } : {} })))),\n footer,\n enableDragClues && (React.createElement(React.Fragment, null,\n React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),\n React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue }))),\n this.showLicenseWatermark && React.createElement(WatermarkOverlay, null)),\n statusBar,\n this.props.pageable && pager)));\n };\n Grid.prototype.selectionChange = function (options) {\n if (this.props.onSelectionChange) {\n var event_1 = options.event, dataItem = options.dataItem, dataIndex = options.dataIndex, columnIndex = options.columnIndex;\n var _a = getSelectionOptions(this.props.selectable), mode = _a.mode, cell = _a.cell;\n var selectionEvent = __assign(__assign({}, this.getArguments(event_1.syntheticEvent)), { dataItem: dataItem, startColIndex: columnIndex, endColIndex: columnIndex, startRowIndex: dataIndex, endRowIndex: dataIndex, dataItems: this.getLeafDataItems(), altKey: false, ctrlKey: false, shiftKey: false, metaKey: false, mode: mode, cell: cell, isDrag: false, componentId: this._gridId, selectedField: this.props.selectedField || '' });\n this.props.onSelectionChange.call(undefined, selectionEvent);\n }\n };\n Grid.prototype.raiseDataEvent = function (handler, data, moreData, syntheticEvent, targetEvent) {\n var dataStateChange = this.props.onDataStateChange;\n if (handler) {\n var ev = __assign(__assign(__assign({}, this.getArguments(syntheticEvent)), data), { targetEvent: targetEvent });\n handler.call(undefined, ev);\n }\n else if (dataStateChange) {\n dataStateChange.call(undefined, __assign(__assign({}, this.getArguments(syntheticEvent)), { targetEvent: targetEvent || {}, dataState: __assign(__assign({}, this.getDataState()), moreData) }));\n }\n };\n Grid.prototype.columnReorder = function (prev, next, nativeEvent) {\n var _a;\n var _this = this;\n var column = this._columns[prev];\n var depth = column.depth;\n var end = function (index) {\n do {\n index++;\n } while (index < _this._columns.length && _this._columns[index].depth > depth);\n return index;\n };\n var spliced = this._columns.splice(prev, end(prev) - prev);\n (_a = this._columns).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced, false));\n this._columns.filter(function (q) { return q.declarationIndex >= 0; }).forEach(function (c, i) { return c.orderIndex = i; });\n this._columnsMutations++;\n var shouldUpdateRL = this._columns[prev].locked && this._columns[next].locked;\n updateLeft(this._columnsMap, this._columns, shouldUpdateRL || this._shouldUpdateLeftRight);\n updateRight(this._columnsMap, this._columns, shouldUpdateRL || this._shouldUpdateLeftRight);\n if (this._resized) {\n this._shouldUpdateLeftRight = false;\n this._resized = false;\n }\n var eventColumnProps = this.columns;\n this.forceUpdate();\n if (this.props.onColumnReorder) {\n var reorderEvent = {\n target: this,\n columns: eventColumnProps,\n columnId: column.id,\n nativeEvent: nativeEvent\n };\n this.props.onColumnReorder.call(undefined, reorderEvent);\n }\n };\n Grid.prototype.groupReorder = function (prevIndex, nextIndex, nativeEvent) {\n if (this.props.group === undefined) {\n return;\n }\n var group = this.props.group.slice();\n group.splice.apply(group, __spreadArray([nextIndex, 0], group.splice(prevIndex, 1), false));\n this.groupChange(group, nativeEvent);\n };\n Grid.prototype.columnToGroup = function (columnIndex, groupIndex, nativeEvent) {\n var field = this._columns[columnIndex].field;\n if (!field) {\n return;\n }\n var group = (this.props.group || []).slice();\n group.splice(groupIndex, 0, { field: field });\n this.groupChange(group, nativeEvent);\n };\n Grid.prototype.resetTableWidth = function () {\n var totalWidth = 0;\n if (!this.columnResize.colGroupMain) {\n return;\n }\n var colElements = this.columnResize.colGroupMain.children;\n for (var i = 0; i < colElements.length; i++) {\n var width = colElements[i].width;\n if (!width) {\n return;\n }\n totalWidth += parseFloat(width.toString());\n }\n totalWidth = Math.round(totalWidth);\n if (this._header) {\n this._header.setWidth(totalWidth);\n }\n if (this._footer) {\n this._footer.setWidth(totalWidth);\n }\n if (this.tableElement) {\n this.tableElement.style.width = totalWidth + 'px';\n }\n };\n Grid.prototype.initColumns = function (children, groupCount) {\n var idPrefix = navigationTools.getIdPrefix(this.navigationStateRef);\n this._columns = this.readColumns(children, idPrefix, this._columnsMutations);\n if (this._columns.length === 0) {\n this._columns = autoGenerateColumns(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: idPrefix });\n }\n this.configureColumns(this._columns, groupCount, idPrefix);\n this._columnsMap = this.mapColumns(this._columns);\n this.columnResize.columns = this._columns;\n this.dragLogic.columns = this._columns;\n };\n Grid.prototype.getDataState = function () {\n return {\n filter: this.props.filter,\n sort: this.props.sort,\n skip: this.props.skip,\n take: (this.props.take !== undefined ? this.props.take : this.props.pageSize),\n group: this.props.group\n };\n };\n Grid.prototype.getArguments = function (syntheticEvent) {\n return {\n nativeEvent: syntheticEvent && syntheticEvent.nativeEvent,\n syntheticEvent: syntheticEvent,\n target: this\n };\n };\n /**\n * @hidden\n */\n Grid.displayName = 'KendoReactGrid';\n /**\n * @hidden\n */\n Grid.defaultProps = {\n // never use this\n };\n /**\n * @hidden\n */\n Grid.propTypes = {\n data: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.shape({\n data: PropTypes.array,\n total: PropTypes.number\n })\n ]),\n sortable: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n mode: PropTypes.oneOf(['single', 'multiple']),\n allowUnsort: PropTypes.bool\n })\n ]),\n onSortChange: PropTypes.func,\n sort: PropTypes.array,\n filterable: PropTypes.bool,\n filter: PropTypes.any,\n onFilterChange: PropTypes.func,\n pageable: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n buttonCount: PropTypes.number,\n info: PropTypes.bool,\n type: PropTypes.oneOf(['numeric', 'input']),\n pageSizes: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.arrayOf(PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number\n ]))\n ]),\n previousNext: PropTypes.bool\n })\n ]),\n pageSize: PropTypes.number,\n onPageChange: PropTypes.func,\n total: PropTypes.number,\n skip: PropTypes.number,\n take: PropTypes.number,\n fixedScroll: PropTypes.bool,\n onExpandChange: PropTypes.func,\n expandField: PropTypes.string,\n selectedField: PropTypes.string,\n onSelectionChange: PropTypes.func,\n onHeaderSelectionChange: PropTypes.func,\n resizable: PropTypes.bool,\n reorderable: PropTypes.bool,\n group: PropTypes.any,\n groupable: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n enabled: PropTypes.bool,\n footer: PropTypes.oneOf(['always', 'visible', 'none'])\n })\n ]),\n onGroupChange: PropTypes.func,\n onRowClick: PropTypes.func,\n onRowDoubleClick: PropTypes.func,\n onItemChange: PropTypes.func,\n editField: PropTypes.string,\n scrollable: PropTypes.oneOf(['none', 'scrollable', 'virtual']),\n rowHeight: PropTypes.number,\n detailRowHeight: PropTypes.number,\n detail: PropTypes.any,\n style: PropTypes.object,\n onDataStateChange: PropTypes.func,\n onColumnResize: PropTypes.func,\n onColumnReorder: PropTypes.func,\n dataItemKey: PropTypes.string,\n navigatable: PropTypes.bool,\n size: PropTypes.oneOf(['small', 'medium'])\n };\n /** @hidden */\n Grid.contextType = TableKeyboardNavigationContext;\n return Grid;\n}(React.Component));\nexport { Grid };\n","//! moment.js\n//! version : 2.30.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\nvar hookCallback;\n\nfunction hooks() {\n return hookCallback.apply(null, arguments);\n}\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\nfunction setHookCallback(callback) {\n hookCallback = callback;\n}\n\nfunction isArray(input) {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n}\n\nfunction isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null &&\n Object.prototype.toString.call(input) === '[object Object]'\n );\n}\n\nfunction hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n}\n\nfunction isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n}\n\nfunction isUndefined(input) {\n return input === void 0;\n}\n\nfunction isNumber(input) {\n return (\n typeof input === 'number' ||\n Object.prototype.toString.call(input) === '[object Number]'\n );\n}\n\nfunction isDate(input) {\n return (\n input instanceof Date ||\n Object.prototype.toString.call(input) === '[object Date]'\n );\n}\n\nfunction map(arr, fn) {\n var res = [],\n i,\n arrLen = arr.length;\n for (i = 0; i < arrLen; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n}\n\nfunction extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n}\n\nfunction createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n}\n\nfunction defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false,\n };\n}\n\nfunction getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n}\n\nvar some;\nif (Array.prototype.some) {\n some = Array.prototype.some;\n} else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n}\n\nfunction isValid(m) {\n var flags = null,\n parsedParts = false,\n isNowValid = m._d && !isNaN(m._d.getTime());\n if (isNowValid) {\n flags = getParsingFlags(m);\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n isNowValid =\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidEra &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n if (m._strict) {\n isNowValid =\n isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n }\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n return m._isValid;\n}\n\nfunction createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n}\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\nvar momentProperties = (hooks.momentProperties = []),\n updateInProgress = false;\n\nfunction copyConfig(to, from) {\n var i,\n prop,\n val,\n momentPropertiesLen = momentProperties.length;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentPropertiesLen > 0) {\n for (i = 0; i < momentPropertiesLen; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n}\n\n// Moment prototype object\nfunction Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n}\n\nfunction isMoment(obj) {\n return (\n obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n );\n}\n\nfunction warn(msg) {\n if (\n hooks.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' &&\n console.warn\n ) {\n console.warn('Deprecation warning: ' + msg);\n }\n}\n\nfunction deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key,\n argLen = arguments.length;\n for (i = 0; i < argLen; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(\n msg +\n '\\nArguments: ' +\n Array.prototype.slice.call(args).join('') +\n '\\n' +\n new Error().stack\n );\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n}\n\nvar deprecations = {};\n\nfunction deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n}\n\nhooks.suppressDeprecationWarnings = false;\nhooks.deprecationHandler = null;\n\nfunction isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n}\n\nfunction set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' +\n /\\d{1,2}/.source\n );\n}\n\nfunction mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (\n hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])\n ) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n}\n\nfunction Locale(config) {\n if (config != null) {\n this.set(config);\n }\n}\n\nvar keys;\n\nif (Object.keys) {\n keys = Object.keys;\n} else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n}\n\nvar defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n};\n\nfunction calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n}\n\nfunction zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (\n (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n absNumber\n );\n}\n\nvar formattingTokens =\n /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\nfunction addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(\n func.apply(this, arguments),\n token\n );\n };\n }\n}\n\nfunction removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n}\n\nfunction makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i])\n ? array[i].call(mom, format)\n : array[i];\n }\n return output;\n };\n}\n\n// format date using native date object\nfunction formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] =\n formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n}\n\nfunction expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(\n localFormattingTokens,\n replaceLongDateFormatTokens\n );\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n}\n\nvar defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n};\n\nfunction longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper\n .match(formattingTokens)\n .map(function (tok) {\n if (\n tok === 'MMMM' ||\n tok === 'MM' ||\n tok === 'DD' ||\n tok === 'dddd'\n ) {\n return tok.slice(1);\n }\n return tok;\n })\n .join('');\n\n return this._longDateFormat[key];\n}\n\nvar defaultInvalidDate = 'Invalid date';\n\nfunction invalidDate() {\n return this._invalidDate;\n}\n\nvar defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\nfunction ordinal(number) {\n return this._ordinal.replace('%d', number);\n}\n\nvar defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n};\n\nfunction relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output)\n ? output(number, withoutSuffix, string, isFuture)\n : output.replace(/%d/i, number);\n}\n\nfunction pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n}\n\nvar aliases = {\n D: 'date',\n dates: 'date',\n date: 'date',\n d: 'day',\n days: 'day',\n day: 'day',\n e: 'weekday',\n weekdays: 'weekday',\n weekday: 'weekday',\n E: 'isoWeekday',\n isoweekdays: 'isoWeekday',\n isoweekday: 'isoWeekday',\n DDD: 'dayOfYear',\n dayofyears: 'dayOfYear',\n dayofyear: 'dayOfYear',\n h: 'hour',\n hours: 'hour',\n hour: 'hour',\n ms: 'millisecond',\n milliseconds: 'millisecond',\n millisecond: 'millisecond',\n m: 'minute',\n minutes: 'minute',\n minute: 'minute',\n M: 'month',\n months: 'month',\n month: 'month',\n Q: 'quarter',\n quarters: 'quarter',\n quarter: 'quarter',\n s: 'second',\n seconds: 'second',\n second: 'second',\n gg: 'weekYear',\n weekyears: 'weekYear',\n weekyear: 'weekYear',\n GG: 'isoWeekYear',\n isoweekyears: 'isoWeekYear',\n isoweekyear: 'isoWeekYear',\n w: 'week',\n weeks: 'week',\n week: 'week',\n W: 'isoWeek',\n isoweeks: 'isoWeek',\n isoweek: 'isoWeek',\n y: 'year',\n years: 'year',\n year: 'year',\n};\n\nfunction normalizeUnits(units) {\n return typeof units === 'string'\n ? aliases[units] || aliases[units.toLowerCase()]\n : undefined;\n}\n\nfunction normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n}\n\nvar priorities = {\n date: 9,\n day: 11,\n weekday: 11,\n isoWeekday: 11,\n dayOfYear: 4,\n hour: 13,\n millisecond: 16,\n minute: 14,\n month: 8,\n quarter: 7,\n second: 15,\n weekYear: 1,\n isoWeekYear: 1,\n week: 5,\n isoWeek: 5,\n year: 1,\n};\n\nfunction getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({ unit: u, priority: priorities[u] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n}\n\nvar match1 = /\\d/, // 0 - 9\n match2 = /\\d\\d/, // 00 - 99\n match3 = /\\d{3}/, // 000 - 999\n match4 = /\\d{4}/, // 0000 - 9999\n match6 = /[+-]?\\d{6}/, // -999999 - 999999\n match1to2 = /\\d\\d?/, // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/, // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/, // 99999 - 999999\n match1to3 = /\\d{1,3}/, // 0 - 999\n match1to4 = /\\d{1,4}/, // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n matchUnsigned = /\\d+/, // 0 - inf\n matchSigned = /[+-]?\\d+/, // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord =\n /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n match1to2NoLeadingZero = /^[1-9]\\d?/, // 1-99\n match1to2HasZero = /^([1-9]\\d|\\d)/, // 0-99\n regexes;\n\nregexes = {};\n\nfunction addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex)\n ? regex\n : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n}\n\nfunction getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n}\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\nfunction unescapeFormat(s) {\n return regexEscape(\n s\n .replace('\\\\', '')\n .replace(\n /\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,\n function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }\n )\n );\n}\n\nfunction regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nfunction absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n}\n\nfunction toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n}\n\nvar tokens = {};\n\nfunction addParseToken(token, callback) {\n var i,\n func = callback,\n tokenLen;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n tokenLen = token.length;\n for (i = 0; i < tokenLen; i++) {\n tokens[token[i]] = func;\n }\n}\n\nfunction addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n}\n\nfunction addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n}\n\nfunction isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\nvar YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n// FORMATTING\n\naddFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n});\n\naddFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n});\n\naddFormatToken(0, ['YYYY', 4], 0, 'year');\naddFormatToken(0, ['YYYYY', 5], 0, 'year');\naddFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// PARSING\n\naddRegexToken('Y', matchSigned);\naddRegexToken('YY', match1to2, match2);\naddRegexToken('YYYY', match1to4, match4);\naddRegexToken('YYYYY', match1to6, match6);\naddRegexToken('YYYYYY', match1to6, match6);\n\naddParseToken(['YYYYY', 'YYYYYY'], YEAR);\naddParseToken('YYYY', function (input, array) {\n array[YEAR] =\n input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n});\naddParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n});\naddParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n});\n\n// HELPERS\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\n// HOOKS\n\nhooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n};\n\n// MOMENTS\n\nvar getSetYear = makeGetSet('FullYear', true);\n\nfunction getIsLeapYear() {\n return isLeapYear(this.year());\n}\n\nfunction makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n}\n\nfunction get(mom, unit) {\n if (!mom.isValid()) {\n return NaN;\n }\n\n var d = mom._d,\n isUTC = mom._isUTC;\n\n switch (unit) {\n case 'Milliseconds':\n return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();\n case 'Seconds':\n return isUTC ? d.getUTCSeconds() : d.getSeconds();\n case 'Minutes':\n return isUTC ? d.getUTCMinutes() : d.getMinutes();\n case 'Hours':\n return isUTC ? d.getUTCHours() : d.getHours();\n case 'Date':\n return isUTC ? d.getUTCDate() : d.getDate();\n case 'Day':\n return isUTC ? d.getUTCDay() : d.getDay();\n case 'Month':\n return isUTC ? d.getUTCMonth() : d.getMonth();\n case 'FullYear':\n return isUTC ? d.getUTCFullYear() : d.getFullYear();\n default:\n return NaN; // Just in case\n }\n}\n\nfunction set$1(mom, unit, value) {\n var d, isUTC, year, month, date;\n\n if (!mom.isValid() || isNaN(value)) {\n return;\n }\n\n d = mom._d;\n isUTC = mom._isUTC;\n\n switch (unit) {\n case 'Milliseconds':\n return void (isUTC\n ? d.setUTCMilliseconds(value)\n : d.setMilliseconds(value));\n case 'Seconds':\n return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));\n case 'Minutes':\n return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));\n case 'Hours':\n return void (isUTC ? d.setUTCHours(value) : d.setHours(value));\n case 'Date':\n return void (isUTC ? d.setUTCDate(value) : d.setDate(value));\n // case 'Day': // Not real\n // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));\n // case 'Month': // Not used because we need to pass two variables\n // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));\n case 'FullYear':\n break; // See below ...\n default:\n return; // Just in case\n }\n\n year = value;\n month = mom.month();\n date = mom.date();\n date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;\n void (isUTC\n ? d.setUTCFullYear(year, month, date)\n : d.setFullYear(year, month, date));\n}\n\n// MOMENTS\n\nfunction stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n}\n\nfunction stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i,\n prioritizedLen = prioritized.length;\n for (i = 0; i < prioritizedLen; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n}\n\nfunction mod(n, x) {\n return ((n % x) + x) % x;\n}\n\nvar indexOf;\n\nif (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n} else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n}\n\nfunction daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1\n ? isLeapYear(year)\n ? 29\n : 28\n : 31 - ((modMonth % 7) % 2);\n}\n\n// FORMATTING\n\naddFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n});\n\naddFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n});\n\naddFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n});\n\n// PARSING\n\naddRegexToken('M', match1to2, match1to2NoLeadingZero);\naddRegexToken('MM', match1to2, match2);\naddRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n});\naddRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n});\n\naddParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n});\n\naddParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n});\n\n// LOCALES\n\nvar defaultLocaleMonths =\n 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n defaultLocaleMonthsShort =\n 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n\nfunction localeMonths(m, format) {\n if (!m) {\n return isArray(this._months)\n ? this._months\n : this._months['standalone'];\n }\n return isArray(this._months)\n ? this._months[m.month()]\n : this._months[\n (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone'\n ][m.month()];\n}\n\nfunction localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort)\n ? this._monthsShort[m.month()]\n : this._monthsShort[\n MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n ][m.month()];\n}\n\nfunction handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp(\n '^' + this.months(mom, '').replace('.', '') + '$',\n 'i'\n );\n this._shortMonthsParse[i] = new RegExp(\n '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n 'i'\n );\n }\n if (!strict && !this._monthsParse[i]) {\n regex =\n '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'MMMM' &&\n this._longMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'MMM' &&\n this._shortMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction setMonth(mom, value) {\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n var month = value,\n date = mom.date();\n\n date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));\n void (mom._isUTC\n ? mom._d.setUTCMonth(month, date)\n : mom._d.setMonth(month, date));\n return mom;\n}\n\nfunction getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n}\n\nfunction getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n}\n\nfunction monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict\n ? this._monthsShortStrictRegex\n : this._monthsShortRegex;\n }\n}\n\nfunction monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict\n ? this._monthsStrictRegex\n : this._monthsRegex;\n }\n}\n\nfunction computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n shortP,\n longP;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortP = regexEscape(this.monthsShort(mom, ''));\n longP = regexEscape(this.months(mom, ''));\n shortPieces.push(shortP);\n longPieces.push(longP);\n mixedPieces.push(longP);\n mixedPieces.push(shortP);\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._monthsShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n}\n\nfunction createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n}\n\nfunction createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n}\n\n// start-of-first-week - start-of-year\nfunction firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n}\n\n// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\nfunction dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear,\n };\n}\n\nfunction weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear,\n };\n}\n\nfunction weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n}\n\n// FORMATTING\n\naddFormatToken('w', ['ww', 2], 'wo', 'week');\naddFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// PARSING\n\naddRegexToken('w', match1to2, match1to2NoLeadingZero);\naddRegexToken('ww', match1to2, match2);\naddRegexToken('W', match1to2, match1to2NoLeadingZero);\naddRegexToken('WW', match1to2, match2);\n\naddWeekParseToken(\n ['w', 'ww', 'W', 'WW'],\n function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n }\n);\n\n// HELPERS\n\n// LOCALES\n\nfunction localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n}\n\nvar defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n};\n\nfunction localeFirstDayOfWeek() {\n return this._week.dow;\n}\n\nfunction localeFirstDayOfYear() {\n return this._week.doy;\n}\n\n// MOMENTS\n\nfunction getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\nfunction getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\n// FORMATTING\n\naddFormatToken('d', 0, 'do', 'day');\n\naddFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n});\n\naddFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n});\n\naddFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n});\n\naddFormatToken('e', 0, 0, 'weekday');\naddFormatToken('E', 0, 0, 'isoWeekday');\n\n// PARSING\n\naddRegexToken('d', match1to2);\naddRegexToken('e', match1to2);\naddRegexToken('E', match1to2);\naddRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n});\naddRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n});\naddRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n});\n\naddWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n});\n\naddWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n});\n\n// HELPERS\n\nfunction parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n}\n\nfunction parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n}\n\n// LOCALES\nfunction shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n}\n\nvar defaultLocaleWeekdays =\n 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n\nfunction localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays)\n ? this._weekdays\n : this._weekdays[\n m && m !== true && this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone'\n ];\n return m === true\n ? shiftWeekdays(weekdays, this._week.dow)\n : m\n ? weekdays[m.day()]\n : weekdays;\n}\n\nfunction localeWeekdaysShort(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : m\n ? this._weekdaysShort[m.day()]\n : this._weekdaysShort;\n}\n\nfunction localeWeekdaysMin(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : m\n ? this._weekdaysMin[m.day()]\n : this._weekdaysMin;\n}\n\nfunction handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(\n mom,\n ''\n ).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(\n '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._shortWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._minWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n }\n if (!this._weekdaysParse[i]) {\n regex =\n '^' +\n this.weekdays(mom, '') +\n '|^' +\n this.weekdaysShort(mom, '') +\n '|^' +\n this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'dddd' &&\n this._fullWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'ddd' &&\n this._shortWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'dd' &&\n this._minWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n var day = get(this, 'Day');\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n}\n\nfunction getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n}\n\nfunction getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n}\n\nfunction weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict\n ? this._weekdaysStrictRegex\n : this._weekdaysRegex;\n }\n}\n\nfunction weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict\n ? this._weekdaysShortStrictRegex\n : this._weekdaysShortRegex;\n }\n}\n\nfunction weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict\n ? this._weekdaysMinStrictRegex\n : this._weekdaysMinRegex;\n }\n}\n\nfunction computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysMinStrictRegex = new RegExp(\n '^(' + minPieces.join('|') + ')',\n 'i'\n );\n}\n\n// FORMATTING\n\nfunction hFormat() {\n return this.hours() % 12 || 12;\n}\n\nfunction kFormat() {\n return this.hours() || 24;\n}\n\naddFormatToken('H', ['HH', 2], 0, 'hour');\naddFormatToken('h', ['hh', 2], 0, hFormat);\naddFormatToken('k', ['kk', 2], 0, kFormat);\n\naddFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('hmmss', 0, 0, function () {\n return (\n '' +\n hFormat.apply(this) +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n});\n\naddFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('Hmmss', 0, 0, function () {\n return (\n '' +\n this.hours() +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n});\n\nfunction meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(\n this.hours(),\n this.minutes(),\n lowercase\n );\n });\n}\n\nmeridiem('a', true);\nmeridiem('A', false);\n\n// PARSING\n\nfunction matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n}\n\naddRegexToken('a', matchMeridiem);\naddRegexToken('A', matchMeridiem);\naddRegexToken('H', match1to2, match1to2HasZero);\naddRegexToken('h', match1to2, match1to2NoLeadingZero);\naddRegexToken('k', match1to2, match1to2NoLeadingZero);\naddRegexToken('HH', match1to2, match2);\naddRegexToken('hh', match1to2, match2);\naddRegexToken('kk', match1to2, match2);\n\naddRegexToken('hmm', match3to4);\naddRegexToken('hmmss', match5to6);\naddRegexToken('Hmm', match3to4);\naddRegexToken('Hmmss', match5to6);\n\naddParseToken(['H', 'HH'], HOUR);\naddParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n});\naddParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n});\naddParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n});\naddParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n});\n\n// LOCALES\n\nfunction localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n}\n\nvar defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n\nfunction localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n}\n\nvar baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse,\n};\n\n// internal storage for locale config files\nvar locales = {},\n localeFamilies = {},\n globalLocale;\n\nfunction commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n}\n\nfunction normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n}\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\nfunction chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (\n next &&\n next.length >= j &&\n commonPrefix(split, next) >= j - 1\n ) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}\n\nfunction isLocaleNameSane(name) {\n // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n // Ensure name is available and function returns boolean\n return !!(name && name.match('^[^/\\\\\\\\]*$'));\n}\n\nfunction loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (\n locales[name] === undefined &&\n typeof module !== 'undefined' &&\n module &&\n module.exports &&\n isLocaleNameSane(name)\n ) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n}\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\nfunction getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n}\n\nfunction defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple(\n 'defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n );\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config,\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n}\n\nfunction updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n}\n\n// returns locale data\nfunction getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n}\n\nfunction listLocales() {\n return keys(locales);\n}\n\nfunction checkOverflow(m) {\n var overflow,\n a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11\n ? MONTH\n : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n ? DATE\n : a[HOUR] < 0 ||\n a[HOUR] > 24 ||\n (a[HOUR] === 24 &&\n (a[MINUTE] !== 0 ||\n a[SECOND] !== 0 ||\n a[MILLISECOND] !== 0))\n ? HOUR\n : a[MINUTE] < 0 || a[MINUTE] > 59\n ? MINUTE\n : a[SECOND] < 0 || a[SECOND] > 59\n ? SECOND\n : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n ? MILLISECOND\n : -1;\n\n if (\n getParsingFlags(m)._overflowDayOfYear &&\n (overflow < YEAR || overflow > DATE)\n ) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n}\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\nvar extendedIsoRegex =\n /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex =\n /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/],\n ['YYYYMM', /\\d{6}/, false],\n ['YYYY', /\\d{4}/, false],\n ],\n // iso time formats and regexes\n isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/],\n ],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n };\n\n// date from iso format\nfunction configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat,\n isoDatesLen = isoDates.length,\n isoTimesLen = isoTimes.length;\n\n if (match) {\n getParsingFlags(config).iso = true;\n for (i = 0, l = isoDatesLen; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimesLen; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n}\n\nfunction extractFromRFC2822Strings(\n yearStr,\n monthStr,\n dayStr,\n hourStr,\n minuteStr,\n secondStr\n) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10),\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n}\n\nfunction untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ')\n .replace(/^\\s\\s*/, '')\n .replace(/\\s\\s*$/, '');\n}\n\nfunction checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(\n parsedInput[0],\n parsedInput[1],\n parsedInput[2]\n ).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n}\n\nfunction calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n}\n\n// date and time from ref 2822 format\nfunction configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(\n match[4],\n match[3],\n match[2],\n match[5],\n match[6],\n match[7]\n );\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n}\n\n// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\nfunction configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n}\n\nhooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n);\n\n// Pick the first defined of two or three arguments.\nfunction defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n}\n\nfunction currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [\n nowValue.getUTCFullYear(),\n nowValue.getUTCMonth(),\n nowValue.getUTCDate(),\n ];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n}\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\nfunction configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n}\n\nfunction dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(\n w.GG,\n config._a[YEAR],\n weekOfYear(createLocal(), 1, 4).year\n );\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n}\n\n// constant that refers to the ISO standard\nhooks.ISO_8601 = function () {};\n\n// constant that refers to the RFC 2822 form\nhooks.RFC_2822 = function () {};\n\n// date from string and format string\nfunction configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era,\n tokenLen;\n\n tokens =\n expandFormat(config._f, config._locale).match(formattingTokens) || [];\n tokenLen = tokens.length;\n for (i = 0; i < tokenLen; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(\n string.indexOf(parsedInput) + parsedInput.length\n );\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver =\n stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (\n config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0\n ) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(\n config._locale,\n config._a[HOUR],\n config._meridiem\n );\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n\n configFromArray(config);\n checkOverflow(config);\n}\n\nfunction meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n}\n\n// date from string and array of format strings\nfunction configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false,\n configfLen = config._f.length;\n\n if (configfLen === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < configfLen; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (!bestFormatIsValid) {\n if (\n scoreToBeat == null ||\n currentScore < scoreToBeat ||\n validFormatFound\n ) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n\n extend(config, bestMoment || tempConfig);\n}\n\nfunction configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map(\n [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n function (obj) {\n return obj && parseInt(obj, 10);\n }\n );\n\n configFromArray(config);\n}\n\nfunction createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n}\n\nfunction prepareConfig(config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({ nullInput: true });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n}\n\nfunction configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n}\n\nfunction createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (\n (isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)\n ) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n}\n\nfunction createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n}\n\nvar prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n ),\n prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\nfunction pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n}\n\n// TODO: Use [].sort instead?\nfunction min() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}\n\nfunction max() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n}\n\nvar now = function () {\n return Date.now ? Date.now() : +new Date();\n};\n\nvar ordering = [\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'millisecond',\n];\n\nfunction isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i,\n orderLen = ordering.length;\n for (key in m) {\n if (\n hasOwnProp(m, key) &&\n !(\n indexOf.call(ordering, key) !== -1 &&\n (m[key] == null || !isNaN(m[key]))\n )\n ) {\n return false;\n }\n }\n\n for (i = 0; i < orderLen; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n}\n\nfunction isValid$1() {\n return this._isValid;\n}\n\nfunction createInvalid$1() {\n return createDuration(NaN);\n}\n\nfunction Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds =\n +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n}\n\nfunction isDuration(obj) {\n return obj instanceof Duration;\n}\n\nfunction absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n}\n\n// compare two arrays, return the number of differences\nfunction compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}\n\n// FORMATTING\n\nfunction offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return (\n sign +\n zeroFill(~~(offset / 60), 2) +\n separator +\n zeroFill(~~offset % 60, 2)\n );\n });\n}\n\noffset('Z', ':');\noffset('ZZ', '');\n\n// PARSING\n\naddRegexToken('Z', matchShortOffset);\naddRegexToken('ZZ', matchShortOffset);\naddParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n});\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\nvar chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\nfunction offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n\n if (matches === null) {\n return null;\n }\n\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n}\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\nfunction cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff =\n (isMoment(input) || isDate(input)\n ? input.valueOf()\n : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n}\n\nfunction getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n}\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\nhooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\nfunction getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(\n this,\n createDuration(input - offset, 'm'),\n 1,\n false\n );\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}\n\nfunction getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n}\n\nfunction setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n}\n\nfunction setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n}\n\nfunction setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n}\n\nfunction hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n}\n\nfunction isDaylightSavingTime() {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n}\n\nfunction isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {},\n other;\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted =\n this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n}\n\nfunction isLocal() {\n return this.isValid() ? !this._isUTC : false;\n}\n\nfunction isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n}\n\nfunction isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n}\n\n// ASP.NET json date format regex\nvar aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex =\n /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\nfunction createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months,\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if ((match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n };\n } else if ((match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign),\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (\n typeof duration === 'object' &&\n ('from' in duration || 'to' in duration)\n ) {\n diffRes = momentsDifference(\n createLocal(duration.from),\n createLocal(duration.to)\n );\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n\n return ret;\n}\n\ncreateDuration.fn = Duration.prototype;\ncreateDuration.invalid = createInvalid$1;\n\nfunction parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n}\n\nfunction positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months =\n other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n return res;\n}\n\nfunction momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return { milliseconds: 0, months: 0 };\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n}\n\n// TODO: remove 'name' arg after deprecation is removed\nfunction createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n}\n\nfunction addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n}\n\nvar add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n\nfunction isString(input) {\n return typeof input === 'string' || input instanceof String;\n}\n\n// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\nfunction isMomentInput(input) {\n return (\n isMoment(input) ||\n isDate(input) ||\n isString(input) ||\n isNumber(input) ||\n isNumberOrStringArray(input) ||\n isMomentInputObject(input) ||\n input === null ||\n input === undefined\n );\n}\n\nfunction isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'years',\n 'year',\n 'y',\n 'months',\n 'month',\n 'M',\n 'days',\n 'day',\n 'd',\n 'dates',\n 'date',\n 'D',\n 'hours',\n 'hour',\n 'h',\n 'minutes',\n 'minute',\n 'm',\n 'seconds',\n 'second',\n 's',\n 'milliseconds',\n 'millisecond',\n 'ms',\n ],\n i,\n property,\n propertyLen = properties.length;\n\n for (i = 0; i < propertyLen; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n}\n\nfunction isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest =\n input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n}\n\nfunction isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'sameDay',\n 'nextDay',\n 'lastDay',\n 'nextWeek',\n 'lastWeek',\n 'sameElse',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n}\n\nfunction getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6\n ? 'sameElse'\n : diff < -1\n ? 'lastWeek'\n : diff < 0\n ? 'lastDay'\n : diff < 1\n ? 'sameDay'\n : diff < 2\n ? 'nextDay'\n : diff < 7\n ? 'nextWeek'\n : 'sameElse';\n}\n\nfunction calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output =\n formats &&\n (isFunction(formats[format])\n ? formats[format].call(this, now)\n : formats[format]);\n\n return this.format(\n output || this.localeData().calendar(format, this, createLocal(now))\n );\n}\n\nfunction clone() {\n return new Moment(this);\n}\n\nfunction isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n}\n\nfunction isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n}\n\nfunction isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (\n (inclusivity[0] === '('\n ? this.isAfter(localFrom, units)\n : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')'\n ? this.isBefore(localTo, units)\n : !this.isAfter(localTo, units))\n );\n}\n\nfunction isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return (\n this.clone().startOf(units).valueOf() <= inputMs &&\n inputMs <= this.clone().endOf(units).valueOf()\n );\n }\n}\n\nfunction isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n}\n\nfunction isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n}\n\nfunction diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break; // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break; // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break; // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break; // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n}\n\nfunction monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n}\n\nhooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\nhooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\nfunction toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n}\n\nfunction toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(\n m,\n utc\n ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n .toISOString()\n .replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(\n m,\n utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n}\n\n/**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\nfunction inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}\n\nfunction format(inputString) {\n if (!inputString) {\n inputString = this.isUtc()\n ? hooks.defaultFormatUtc\n : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n}\n\nfunction from(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ to: this, from: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n}\n\nfunction to(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ from: this, to: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n}\n\n// If passed a locale key, it will set the locale for this\n// instance. Otherwise, it will return the locale configuration\n// variables for this instance.\nfunction locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}\n\nvar lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n);\n\nfunction localeData() {\n return this._locale;\n}\n\nvar MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n// actual modulo - handles negative numbers (for dates before 1970):\nfunction mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n}\n\nfunction localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n}\n\nfunction utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n}\n\nfunction startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(\n this.year(),\n this.month() - (this.month() % 3),\n 1\n );\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday()\n );\n break;\n case 'isoWeek':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1)\n );\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n );\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n}\n\nfunction endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time =\n startOfDate(\n this.year(),\n this.month() - (this.month() % 3) + 3,\n 1\n ) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday() + 7\n ) - 1;\n break;\n case 'isoWeek':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1) + 7\n ) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time +=\n MS_PER_HOUR -\n mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n ) -\n 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n}\n\nfunction valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n}\n\nfunction unix() {\n return Math.floor(this.valueOf() / 1000);\n}\n\nfunction toDate() {\n return new Date(this.valueOf());\n}\n\nfunction toArray() {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hour(),\n m.minute(),\n m.second(),\n m.millisecond(),\n ];\n}\n\nfunction toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds(),\n };\n}\n\nfunction toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n}\n\nfunction isValid$2() {\n return isValid(this);\n}\n\nfunction parsingFlags() {\n return extend({}, getParsingFlags(this));\n}\n\nfunction invalidAt() {\n return getParsingFlags(this).overflow;\n}\n\nfunction creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict,\n };\n}\n\naddFormatToken('N', 0, 0, 'eraAbbr');\naddFormatToken('NN', 0, 0, 'eraAbbr');\naddFormatToken('NNN', 0, 0, 'eraAbbr');\naddFormatToken('NNNN', 0, 0, 'eraName');\naddFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\naddFormatToken('y', ['y', 1], 'yo', 'eraYear');\naddFormatToken('y', ['yy', 2], 0, 'eraYear');\naddFormatToken('y', ['yyy', 3], 0, 'eraYear');\naddFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\naddRegexToken('N', matchEraAbbr);\naddRegexToken('NN', matchEraAbbr);\naddRegexToken('NNN', matchEraAbbr);\naddRegexToken('NNNN', matchEraName);\naddRegexToken('NNNNN', matchEraNarrow);\n\naddParseToken(\n ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],\n function (input, array, config, token) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n }\n);\n\naddRegexToken('y', matchUnsigned);\naddRegexToken('yy', matchUnsigned);\naddRegexToken('yyy', matchUnsigned);\naddRegexToken('yyyy', matchUnsigned);\naddRegexToken('yo', matchEraYearOrdinal);\n\naddParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\naddParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n});\n\nfunction localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n}\n\nfunction localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n}\n\nfunction localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n}\n\nfunction getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n\n return '';\n}\n\nfunction getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n\n return '';\n}\n\nfunction getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n\n return '';\n}\n\nfunction getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (\n (eras[i].since <= val && val <= eras[i].until) ||\n (eras[i].until <= val && val <= eras[i].since)\n ) {\n return (\n (this.year() - hooks(eras[i].since).year()) * dir +\n eras[i].offset\n );\n }\n }\n\n return this.year();\n}\n\nfunction erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n}\n\nfunction erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n}\n\nfunction erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n}\n\nfunction matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n}\n\nfunction matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n}\n\nfunction matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n}\n\nfunction matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n}\n\nfunction computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n erasName,\n erasAbbr,\n erasNarrow,\n eras = this.eras();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n erasName = regexEscape(eras[i].name);\n erasAbbr = regexEscape(eras[i].abbr);\n erasNarrow = regexEscape(eras[i].narrow);\n\n namePieces.push(erasName);\n abbrPieces.push(erasAbbr);\n narrowPieces.push(erasNarrow);\n mixedPieces.push(erasName);\n mixedPieces.push(erasAbbr);\n mixedPieces.push(erasNarrow);\n }\n\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp(\n '^(' + narrowPieces.join('|') + ')',\n 'i'\n );\n}\n\n// FORMATTING\n\naddFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n});\n\naddFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n});\n\nfunction addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n}\n\naddWeekYearFormatToken('gggg', 'weekYear');\naddWeekYearFormatToken('ggggg', 'weekYear');\naddWeekYearFormatToken('GGGG', 'isoWeekYear');\naddWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\n// PARSING\n\naddRegexToken('G', matchSigned);\naddRegexToken('g', matchSigned);\naddRegexToken('GG', match1to2, match2);\naddRegexToken('gg', match1to2, match2);\naddRegexToken('GGGG', match1to4, match4);\naddRegexToken('gggg', match1to4, match4);\naddRegexToken('GGGGG', match1to6, match6);\naddRegexToken('ggggg', match1to6, match6);\n\naddWeekParseToken(\n ['gggg', 'ggggg', 'GGGG', 'GGGGG'],\n function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n }\n);\n\naddWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n});\n\n// MOMENTS\n\nfunction getSetWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.week(),\n this.weekday() + this.localeData()._week.dow,\n this.localeData()._week.dow,\n this.localeData()._week.doy\n );\n}\n\nfunction getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.isoWeek(),\n this.isoWeekday(),\n 1,\n 4\n );\n}\n\nfunction getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n}\n\nfunction getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n}\n\nfunction getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n}\n\nfunction getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n}\n\nfunction getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n}\n\nfunction setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n}\n\n// FORMATTING\n\naddFormatToken('Q', 0, 'Qo', 'quarter');\n\n// PARSING\n\naddRegexToken('Q', match1);\naddParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n});\n\n// MOMENTS\n\nfunction getSetQuarter(input) {\n return input == null\n ? Math.ceil((this.month() + 1) / 3)\n : this.month((input - 1) * 3 + (this.month() % 3));\n}\n\n// FORMATTING\n\naddFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// PARSING\n\naddRegexToken('D', match1to2, match1to2NoLeadingZero);\naddRegexToken('DD', match1to2, match2);\naddRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict\n ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n : locale._dayOfMonthOrdinalParseLenient;\n});\n\naddParseToken(['D', 'DD'], DATE);\naddParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n});\n\n// MOMENTS\n\nvar getSetDayOfMonth = makeGetSet('Date', true);\n\n// FORMATTING\n\naddFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// PARSING\n\naddRegexToken('DDD', match1to3);\naddRegexToken('DDDD', match3);\naddParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n});\n\n// HELPERS\n\n// MOMENTS\n\nfunction getSetDayOfYear(input) {\n var dayOfYear =\n Math.round(\n (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n ) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n}\n\n// FORMATTING\n\naddFormatToken('m', ['mm', 2], 0, 'minute');\n\n// PARSING\n\naddRegexToken('m', match1to2, match1to2HasZero);\naddRegexToken('mm', match1to2, match2);\naddParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\nvar getSetMinute = makeGetSet('Minutes', false);\n\n// FORMATTING\n\naddFormatToken('s', ['ss', 2], 0, 'second');\n\n// PARSING\n\naddRegexToken('s', match1to2, match1to2HasZero);\naddRegexToken('ss', match1to2, match2);\naddParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\nvar getSetSecond = makeGetSet('Seconds', false);\n\n// FORMATTING\n\naddFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n});\n\naddFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n});\n\naddFormatToken(0, ['SSS', 3], 0, 'millisecond');\naddFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n});\naddFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n});\naddFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n});\naddFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n});\naddFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n});\naddFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n});\n\n// PARSING\n\naddRegexToken('S', match1to3, match1);\naddRegexToken('SS', match1to3, match2);\naddRegexToken('SSS', match1to3, match3);\n\nvar token, getSetMillisecond;\nfor (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n}\n\nfunction parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n}\n\nfor (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n}\n\ngetSetMillisecond = makeGetSet('Milliseconds', false);\n\n// FORMATTING\n\naddFormatToken('z', 0, 0, 'zoneAbbr');\naddFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\nfunction getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n}\n\nfunction getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n}\n\nvar proto = Moment.prototype;\n\nproto.add = add;\nproto.calendar = calendar$1;\nproto.clone = clone;\nproto.diff = diff;\nproto.endOf = endOf;\nproto.format = format;\nproto.from = from;\nproto.fromNow = fromNow;\nproto.to = to;\nproto.toNow = toNow;\nproto.get = stringGet;\nproto.invalidAt = invalidAt;\nproto.isAfter = isAfter;\nproto.isBefore = isBefore;\nproto.isBetween = isBetween;\nproto.isSame = isSame;\nproto.isSameOrAfter = isSameOrAfter;\nproto.isSameOrBefore = isSameOrBefore;\nproto.isValid = isValid$2;\nproto.lang = lang;\nproto.locale = locale;\nproto.localeData = localeData;\nproto.max = prototypeMax;\nproto.min = prototypeMin;\nproto.parsingFlags = parsingFlags;\nproto.set = stringSet;\nproto.startOf = startOf;\nproto.subtract = subtract;\nproto.toArray = toArray;\nproto.toObject = toObject;\nproto.toDate = toDate;\nproto.toISOString = toISOString;\nproto.inspect = inspect;\nif (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n}\nproto.toJSON = toJSON;\nproto.toString = toString;\nproto.unix = unix;\nproto.valueOf = valueOf;\nproto.creationData = creationData;\nproto.eraName = getEraName;\nproto.eraNarrow = getEraNarrow;\nproto.eraAbbr = getEraAbbr;\nproto.eraYear = getEraYear;\nproto.year = getSetYear;\nproto.isLeapYear = getIsLeapYear;\nproto.weekYear = getSetWeekYear;\nproto.isoWeekYear = getSetISOWeekYear;\nproto.quarter = proto.quarters = getSetQuarter;\nproto.month = getSetMonth;\nproto.daysInMonth = getDaysInMonth;\nproto.week = proto.weeks = getSetWeek;\nproto.isoWeek = proto.isoWeeks = getSetISOWeek;\nproto.weeksInYear = getWeeksInYear;\nproto.weeksInWeekYear = getWeeksInWeekYear;\nproto.isoWeeksInYear = getISOWeeksInYear;\nproto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\nproto.date = getSetDayOfMonth;\nproto.day = proto.days = getSetDayOfWeek;\nproto.weekday = getSetLocaleDayOfWeek;\nproto.isoWeekday = getSetISODayOfWeek;\nproto.dayOfYear = getSetDayOfYear;\nproto.hour = proto.hours = getSetHour;\nproto.minute = proto.minutes = getSetMinute;\nproto.second = proto.seconds = getSetSecond;\nproto.millisecond = proto.milliseconds = getSetMillisecond;\nproto.utcOffset = getSetOffset;\nproto.utc = setOffsetToUTC;\nproto.local = setOffsetToLocal;\nproto.parseZone = setOffsetToParsedOffset;\nproto.hasAlignedHourOffset = hasAlignedHourOffset;\nproto.isDST = isDaylightSavingTime;\nproto.isLocal = isLocal;\nproto.isUtcOffset = isUtcOffset;\nproto.isUtc = isUtc;\nproto.isUTC = isUtc;\nproto.zoneAbbr = getZoneAbbr;\nproto.zoneName = getZoneName;\nproto.dates = deprecate(\n 'dates accessor is deprecated. Use date instead.',\n getSetDayOfMonth\n);\nproto.months = deprecate(\n 'months accessor is deprecated. Use month instead',\n getSetMonth\n);\nproto.years = deprecate(\n 'years accessor is deprecated. Use year instead',\n getSetYear\n);\nproto.zone = deprecate(\n 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n getSetZone\n);\nproto.isDSTShifted = deprecate(\n 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n isDaylightSavingTimeShifted\n);\n\nfunction createUnix(input) {\n return createLocal(input * 1000);\n}\n\nfunction createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n}\n\nfunction preParsePostFormat(string) {\n return string;\n}\n\nvar proto$1 = Locale.prototype;\n\nproto$1.calendar = calendar;\nproto$1.longDateFormat = longDateFormat;\nproto$1.invalidDate = invalidDate;\nproto$1.ordinal = ordinal;\nproto$1.preparse = preParsePostFormat;\nproto$1.postformat = preParsePostFormat;\nproto$1.relativeTime = relativeTime;\nproto$1.pastFuture = pastFuture;\nproto$1.set = set;\nproto$1.eras = localeEras;\nproto$1.erasParse = localeErasParse;\nproto$1.erasConvertYear = localeErasConvertYear;\nproto$1.erasAbbrRegex = erasAbbrRegex;\nproto$1.erasNameRegex = erasNameRegex;\nproto$1.erasNarrowRegex = erasNarrowRegex;\n\nproto$1.months = localeMonths;\nproto$1.monthsShort = localeMonthsShort;\nproto$1.monthsParse = localeMonthsParse;\nproto$1.monthsRegex = monthsRegex;\nproto$1.monthsShortRegex = monthsShortRegex;\nproto$1.week = localeWeek;\nproto$1.firstDayOfYear = localeFirstDayOfYear;\nproto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\nproto$1.weekdays = localeWeekdays;\nproto$1.weekdaysMin = localeWeekdaysMin;\nproto$1.weekdaysShort = localeWeekdaysShort;\nproto$1.weekdaysParse = localeWeekdaysParse;\n\nproto$1.weekdaysRegex = weekdaysRegex;\nproto$1.weekdaysShortRegex = weekdaysShortRegex;\nproto$1.weekdaysMinRegex = weekdaysMinRegex;\n\nproto$1.isPM = localeIsPM;\nproto$1.meridiem = localeMeridiem;\n\nfunction get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n}\n\nfunction listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n}\n\n// ()\n// (5)\n// (fmt, 5)\n// (fmt)\n// (true)\n// (true, 5)\n// (true, fmt, 5)\n// (true, fmt)\nfunction listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n}\n\nfunction listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n}\n\nfunction listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n}\n\nfunction listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n}\n\nfunction listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n}\n\nfunction listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n}\n\ngetSetGlobalLocale('en', {\n eras: [\n {\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n toInt((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n});\n\n// Side effect imports\n\nhooks.lang = deprecate(\n 'moment.lang is deprecated. Use moment.locale instead.',\n getSetGlobalLocale\n);\nhooks.langData = deprecate(\n 'moment.langData is deprecated. Use moment.localeData instead.',\n getLocale\n);\n\nvar mathAbs = Math.abs;\n\nfunction abs() {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n}\n\nfunction addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n}\n\n// supports only 2.0-style add(1, 's') or add(duration)\nfunction add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n}\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\nfunction subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n}\n\nfunction absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n}\n\nfunction bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (\n !(\n (milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0)\n )\n ) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n}\n\nfunction daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return (days * 4800) / 146097;\n}\n\nfunction monthsToDays(months) {\n // the reverse of daysToMonths\n return (months * 146097) / 4800;\n}\n\nfunction as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n}\n\nfunction makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n}\n\nvar asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y'),\n valueOf$1 = asMilliseconds;\n\nfunction clone$1() {\n return createDuration(this);\n}\n\nfunction get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n}\n\nfunction makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n}\n\nvar milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n\nfunction weeks() {\n return absFloor(this.days() / 7);\n}\n\nvar round = Math.round,\n thresholds = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month/week\n w: null, // weeks to month\n M: 11, // months to year\n };\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\nfunction substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n}\n\nfunction relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a =\n (seconds <= thresholds.ss && ['s', seconds]) ||\n (seconds < thresholds.s && ['ss', seconds]) ||\n (minutes <= 1 && ['m']) ||\n (minutes < thresholds.m && ['mm', minutes]) ||\n (hours <= 1 && ['h']) ||\n (hours < thresholds.h && ['hh', hours]) ||\n (days <= 1 && ['d']) ||\n (days < thresholds.d && ['dd', days]);\n\n if (thresholds.w != null) {\n a =\n a ||\n (weeks <= 1 && ['w']) ||\n (weeks < thresholds.w && ['ww', weeks]);\n }\n a = a ||\n (months <= 1 && ['M']) ||\n (months < thresholds.M && ['MM', months]) ||\n (years <= 1 && ['y']) || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n}\n\n// This function allows you to set the rounding function for relative time strings\nfunction getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}\n\n// This function allows you to set a threshold for relative time strings\nfunction getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n}\n\nfunction humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n}\n\nvar abs$1 = Math.abs;\n\nfunction sign(x) {\n return (x > 0) - (x < 0) || +x;\n}\n\nfunction toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return (\n totalSign +\n 'P' +\n (years ? ymSign + years + 'Y' : '') +\n (months ? ymSign + months + 'M' : '') +\n (days ? daysSign + days + 'D' : '') +\n (hours || minutes || seconds ? 'T' : '') +\n (hours ? hmsSign + hours + 'H' : '') +\n (minutes ? hmsSign + minutes + 'M' : '') +\n (seconds ? hmsSign + s + 'S' : '')\n );\n}\n\nvar proto$2 = Duration.prototype;\n\nproto$2.isValid = isValid$1;\nproto$2.abs = abs;\nproto$2.add = add$1;\nproto$2.subtract = subtract$1;\nproto$2.as = as;\nproto$2.asMilliseconds = asMilliseconds;\nproto$2.asSeconds = asSeconds;\nproto$2.asMinutes = asMinutes;\nproto$2.asHours = asHours;\nproto$2.asDays = asDays;\nproto$2.asWeeks = asWeeks;\nproto$2.asMonths = asMonths;\nproto$2.asQuarters = asQuarters;\nproto$2.asYears = asYears;\nproto$2.valueOf = valueOf$1;\nproto$2._bubble = bubble;\nproto$2.clone = clone$1;\nproto$2.get = get$2;\nproto$2.milliseconds = milliseconds;\nproto$2.seconds = seconds;\nproto$2.minutes = minutes;\nproto$2.hours = hours;\nproto$2.days = days;\nproto$2.weeks = weeks;\nproto$2.months = months;\nproto$2.years = years;\nproto$2.humanize = humanize;\nproto$2.toISOString = toISOString$1;\nproto$2.toString = toISOString$1;\nproto$2.toJSON = toISOString$1;\nproto$2.locale = locale;\nproto$2.localeData = localeData;\n\nproto$2.toIsoString = deprecate(\n 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n toISOString$1\n);\nproto$2.lang = lang;\n\n// FORMATTING\n\naddFormatToken('X', 0, 0, 'unix');\naddFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\naddRegexToken('x', matchSigned);\naddRegexToken('X', matchTimestamp);\naddParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n});\naddParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n});\n\n//! moment.js\n\nhooks.version = '2.30.1';\n\nsetHookCallback(createLocal);\n\nhooks.fn = proto;\nhooks.min = min;\nhooks.max = max;\nhooks.now = now;\nhooks.utc = createUTC;\nhooks.unix = createUnix;\nhooks.months = listMonths;\nhooks.isDate = isDate;\nhooks.locale = getSetGlobalLocale;\nhooks.invalid = createInvalid;\nhooks.duration = createDuration;\nhooks.isMoment = isMoment;\nhooks.weekdays = listWeekdays;\nhooks.parseZone = createInZone;\nhooks.localeData = getLocale;\nhooks.isDuration = isDuration;\nhooks.monthsShort = listMonthsShort;\nhooks.weekdaysMin = listWeekdaysMin;\nhooks.defineLocale = defineLocale;\nhooks.updateLocale = updateLocale;\nhooks.locales = listLocales;\nhooks.weekdaysShort = listWeekdaysShort;\nhooks.normalizeUnits = normalizeUnits;\nhooks.relativeTimeRounding = getSetRelativeTimeRounding;\nhooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\nhooks.calendarFormat = getCalendarFormat;\nhooks.prototype = proto;\n\n// currently HTML5 input type only supports 24-hour formats\nhooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // \n DATE: 'YYYY-MM-DD', // \n TIME: 'HH:mm', // \n TIME_SECONDS: 'HH:mm:ss', // \n TIME_MS: 'HH:mm:ss.SSS', // \n WEEK: 'GGGG-[W]WW', // \n MONTH: 'YYYY-MM', // \n};\n\nexport default hooks;\n","/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ARIA_ATTR: ARIA_ATTR,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n DATA_ATTR: DATA_ATTR,\n DOCTYPE_NAME: DOCTYPE_NAME,\n ERB_EXPR: ERB_EXPR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.2.4';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n };\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function _isNode(value) {\n return typeof Node === 'function' && value instanceof Node;\n };\n function _executeHooks(hooks, currentNode, data) {\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

    ' + func(text) + '

    ';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

    fred, barney, & pebbles

    '\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '